Search code examples
debugginggccformatdefault

command to detect the default debugging format


I was wondering if anyone knows how to read the default debugging format for a given platform.

If you want to help me further, here is the big picture. I'm having problems with gcc storing the full path of some source files in a library(gsl) in xubuntu 11.10 but not doing so in a rocks cluster with redhat. xubuntu has gcc 4.6 and and red hat has 4.1; the redhat cluster is x64 and the xubuntu is x32. These are the differences that I know of. The problem is that gdb finds the source files in ubuntu but not in redhat; in redhat, only the source file names are stored (info sources), without the path. The really strange thing (IMO) is that the code and makefiles are the same in both platforms, the only difference are the paths (which are absolute in both).

So at this point my only clue is that somehow the debugging format by default is not stabs in both platforms. So I wanted to check those in each platform. But if you can give me a hand with the overall problem, I'd appreciate it a lot.


Solution

  • You can try the dwarfdump utility to get additional info about the debugging info in the binaries on the different platforms.

    I'd be surprised if the debugging format was stabs on either platform unless you had explicitly requested it with -gstabs as an argument to gcc. I'm pretty sure that DWARF has been the default for linux intel gcc for a long time. You could check by using readelf -S <binary> to look for a .stab or .stabstr section to see if it is really using stabs.