On Mon, Jun 15, 2009 at 12:10:12PM -0700, Steve Gonczi wrote: > Absolutely no disrespect to mdb, I love the thing for kernel/assembler > debugging. > > However, stepping through source code, walking the stack frames, > seeing local variables effortlessly is still a significant plus. > > What I would ultimately like to see is a 2 machine kernel source > debug environment similar to the Linux kgdb, or the IBM AIX kdbx > environment. Who knows, maybe an Ethernet gdb kernel stub could be > implemented in mdb..
My experience with the gdb protocol has been very negative; it's very poorly designed, and prone to breakage. While some kind of kmdb(1)-over-ethernet might be very cool, you're not likely to see a lot of excitement from Solaris engineering for a source-level kernel debugger; in general, it saves you a very minor amount of your total debugging time, since it's straightforward (if slightly time consuming) to backtrack from the assembly. Figuring out how the datastructures are corrupted and how they got that way is where you spend most of your time. Also, given that we've discovered compiler bugs on innumerable occasions, there's not a lot of trust that the line-number/local variable information provided by the compiler is accurate enough, and turning off optimization to get local variables changes the compiler output significantly compared to what our customers are actually running, and can mask many subtle bugs. Source-level debugging also adds a dependency from "binaries running on system" to "corresponding source on other system" which will be hard to get right in practice. So in summary, getting good source-level kernel debugging is viewed as a large time investment for dubious gain. We'd rather have smarter mdb dcmds or (for example) a better surface syntax for MDB than something which won't actually make the bug analysis we do on a day-to-day basis measurably easier. That's not to say you'd be wasting your time trying to get something like this up-and-running, or that it wouldn't be useful to get better DBX support for userland debugging. Just understand that (especially for kernel source-level support), the arguments have already happened several times in the past, and you're not likely to change the consensus. (I could see DBX/gdb support for device driver writers to be something that someone might find useful. But Solaris engineering probably wouldn't find it so.) Cheers, - jonathan