From: <wil...@ai...> - 2007-09-14 19:48:56
|
On Fri, Sep 14, 2007 at 03:39:40PM +0200, Andreas Bogk wrote: > I recently spent several days trying to debug a problem in a FFI > library, using gdb. As you might know, this is less than fun, due to > gdb's inability to process its own SIGTRAPs differently from SIGTRAPs > raised by the debuggee. And sbcl uses SIGTRAP quite a lot. > > So I looked into ways to get rid of SIGTRAP usage in sbcl, to make my > debugging life easier. I found code for Darwin, which uses SIGILL > instead of SIGTRAP, and an illegal instruction instead of "int 3" to > trigger it. Enabling that code on my platform (x86/Linux) was > straightforward, worked pretty well, and provided me a much smoother > debugging experience. > > I suggest making this behaviour the default. The cost is a two byte > opcode instead of a one byte opcode for the trap instruction, which in > total should be lost in the noise. The win is much better debuggability > with gdb. I think it would be useful to have this in the sources, but I'm at least mildly opposed to enabling it in the default build. I can see its practical importance, because gdb is so ubiquitous. But in some abstract sense it seems clearly the wrong thing --- something we would never consider doing if gdb were less ill-behaved. And debugging FFI code is a sufficiently hard-core niche that I'd expect almost anyone doing that would be capable of rebuilding if necessary. Even without esthetic wrong-thing arguments, if the 80kbyte figure ISTR from IRC is correct, it would be about 0.3% of the core on my machine. It don't think it's unreasonable to say that 0.3% is "lost in the noise" --- but I also think that once you do, you should address the possibility that the proportion of cores where the benefit will be used might be lost in the noise.:-| -- William Harold Newman <wil...@ai...> PGP key fingerprint 85 CE 1C BA 79 8D 51 8C B9 25 FB EE E0 C3 E5 7C "gdb is the enemy of your enemy" -- Dan Barlow |