Stabs or Dwarf Was: [PATCH]: testsuite/gdb.base/constvars.exp
Stan Shebs
shebs@apple.com
Wed Sep 26 14:39:00 GMT 2001
Fernando Nasser wrote:
>
> >From a discussion in gdb-patches
>
> Michael Snyder wrote:
> >
> > (...) we need some kind of test that applies
> > the xfails for stabs and not for dwarf.
> >
>
> There are so many instances where this would be useful that I would
> like to suggest a "gdb_debug_format" procedure to be added to gdb.exp
> that would determine that.
Seems like a good idea to me too.
> We could use a binutils utility on the test file (which we know) and
> parse the output. Does that seem reasonable? Any other suggestions?
I can't think of a completely reliable test on binary files. For
instance, in original a.out, stabs are plain symbols, not in a
distinctly-named section. You also have the problem of an executable
maybe having libraries compiled with stabs, and main prog with dwarf,
and objdump can't distinguish.
On the other, grepping an assembly file produced via -S seems
reliable, since stabs always have at least one ".stabs" line,
and dwarf-2 will always have a .debug_info section mentioned, etc.
All of the compilers that GDB works with have a -S option.
Stan
More information about the Gdb
mailing list