Re:

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mark Zealey wrote:

> On Mon, Oct 15, 2001 at 11:02:58AM -0500, Timur Tabi wrote:
>>A much smarter way to do this would be to use this code:
>>
>>static inline void int3(void) { __asm__ __volatile__ (".byte 0xCC\n"); };
>>


> If you want to do it like that, I'd suggest ud2 for in-kernel use:
> 
> #define b0rk() asm volatile("ud2")


Ok, I figured out what UD2 is.  According to the Intel docs, UD2 is used when 
you want to generate an illegal opcode exception.  However, this is exactly 
what I don't want, since gdb will halt the computer inside the exception 
handler, not at the line of code that caused the exception.

Not only that, but when I do "continue" on the gdb command-line, the computer 
continues merily on its way, as if nothing happened.  This allows use to trap 
error conditions without screwing things up.

Anyway, that's my two cents.

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux