Hi Jonathan, Thanks for providing us with a SUN developer's perspective, and for the new info on config tweaks.
I have gained a tiny bit more insight on this: The debug (-g) option is already set in all the compiles, given that the requisite bldenv is set up as debug. It is currently unclear whether the flag is set set in opensolaris.sh or as a bldenv command line option, but setting both of these certainly works. Because the make option "-e" set by bldenv, any macro set in Makefile.master can be simply over-ridden by just setting it in the current build shell. This means, no editing of Makefile.master is necessary. E.g. in my environment (tcsh) I simply issue: setenv DEBUGFORMAT -xdebugformat=dwarf; setenv COPTFLAG; setenv COPTFLAG64; This effectively shuts off all optimizations, and switches to DWARF output for any subsequent debug userland builds. In addition, run dbx via ddd --dbx, and we have ourselves a neat gui source debug environment. Gdb does not seem to work with the SUN toolchain. For gdb afficionados, dbx commands can be munged into a gdb-like command set via .dbxrc macros. 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.. -- This message posted from opensolaris.org