Re:

Timur Tabi
2001-10-15T16:18:25Z

David Ford wrote:

> That should throw a segmentation fault, in the kernel an OOPS, in this
> statement the code is trying to dereference a NULL pointer and store a
> value at 0x0.

I much smarter way to do this would be to use this code:

static inline void int3(void) { __asm__ __volatile__ (".byte 0xCC\n"); };

Granted, it's x86-specific, but it works better, since gdb will halt the code
right at that spot rather than inside some trap hander. And it's just more
elegant.