On Mon, Oct 15, 2001 at 11:02:58AM -0500, Timur Tabi wrote: > 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. If you want to do it like that, I'd suggest ud2 for in-kernel use: #define b0rk() asm volatile("ud2") -- Mark Zealey (aka JALH on irc.openprojects.net: #zealos and many more) mark@zealos.org mark@itsolve.co.uk UL++++>$ G!>(GCM/GCS/GS/GM) dpu? s:-@ a16! C++++>$ P++++>+++++$ L+++>+++++$ !E---? W+++>$ N- !o? !w--- O? !M? !V? !PS !PE--@ PGP+? r++ !t---?@ !X---? !R- b+ !tv b+ DI+ D+? G+++ e>+++++ !h++* r!-- y-- (www.geekcode.com) - 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/