On Fri, Jun 12, 2009 at 03:04:55PM -0700, Steve Gonczi wrote: > I did the full nightly, then edited the Makefile.master debug setting so it > generates dwarf debug info. Killed the CTF* utilities as outlined > previously in this thread. > Recompiled libzpool and libzfs from their usr/src/lib/libz* directories ( > make clean|clobber, usually try both, then make or make install - also try > both). > After the successful compile, set LD_LIBRARY_PATH > to where the freshly baked libzpool lives. Do not forget the semicolon after > the search path, must be prefixed by \ else the shell strips it. > > I did not need to capture, and edit the make output. > > Things are mostly working now. It is beyond me why this would not > work with stabs. The only remaining thing is to turn off optimizing, > so I can look at local variables.
Just jumping in here after the fact, but I thought I'd give some background: Most of the engineers working in ON got started with kernel programming on Solaris, and so have a large amount of background with MDB and assembly-level debugging. The CTF data provides all of the structure printing you might need using MDB, and the experience with assembly provides the "map stack trace to C program locations", along with figuring out which local variables are where, etc. Since most kernel engineers aren't familiar with DBX, there's not a huge community clamoring for the ability to use it. The CTF tools process the debugging information (stabs or dwarf) in order to generate the C type information MDB uses. By default, they also strip all other debugging information from the binaries, since they bloat the binary sizes and aren't wanted in our shipping products. Unfortunately, there is no easy way to add the '-g' flag to disable that stripping, except for: CTFCVTFLAGS='-i -L VERSION -g' CTFMGRFLAGS='-g' dmake install I think that a set of simple environment settings which would enable this for a build or part there-of would be useful, so you could do something like: (after a full nightly build) cd usr/src/lib/libzpool dmake clobber KEEP_DEBUG_INFO=yes DEBUG_TYPE=dwarf dmake install and have both CTF and dwarf info would be a good RFE. Cheers, - jonathan