08-17-05 10:59 PM
Hi,
Maybe this might be specific to gcc.I am working on Solaris 8, and in
the process of debugging some 64 bit executable,needed to use the
studio8 dbx debugger,because the default gdb cannot load 64 bit binaries
for debugging.
Now while compiling with debug options (passing -g),when working with
gdb might work fine as gcc emits extra information specific to gdb.
From the gcc Man Page :
-g
Produce debugging information in the operating system's native
format (stabs, COFF, XCOFF, or DWARF). GDB can work with this debugging
information.
On most systems that use stabs format, -g enables use of extra
debugging information that only GDB can use; this extra information
makes debugging work better in GDB but will probably make other
debuggers crash or refuse to read the program. If you want to control
for certain whether to generate the extra information, use -gstabs+,
-gstabs, -gxcoff+, -gxcoff, or -gvms
What debug flags should I use use for DBX ? The below macro from the gcc
info pages tells :
DBX_DEBUGGING_INFO
Define this macro if GCC should produce debugging output for DBX in
response to the -g option.
Now with response to this macro,which is the flag that gets passed.Again
it depends on the OS's native format.How do I know whats the native
format for Solaris on SPARC ?If I would have used Sun's native
compiler,then it would automatically generate the debug info in a format
which dbx can understand.
There are multiple options like : -g -ggdb -gstabs -gstabs+ -gcoff
-gdwarf ... and I am not sure which should be the correct option.What if
I pass all the options , will it then pick up correctly according to the
native format of the OS.
Any light on this will be highly appreciated.
Thanks,
[ Post a follow-up to this message ]
|