Re: Executable's debug format

Ian Lance Taylor
2004-02-13T03:03:13Z

Bob Rossi <bob@brasko.net> writes:

> Is there a way to find out what debug format the debugging info in the
> executable is in?

Yes, but I don't know of a trivial way.

Run objdump -h to see the sections.

If the program has a .debug it is using DWARF 1.

If the program has a .debug_info it is using DWARF 2.

If the program has .stab and .stabstr sections it is using stabs
debugging information.

There are many other possibilities, though those are the most common
these days.

> Or is it more complicated? Can a single executable be composed of object
> files which each have there debugging info in a different format?

Yes, that is possible, though very unusual.

Ian