Debugging with stabs on Solaris x86 with GCC and the native as

Mark Kettenis kettenis@chello.nl
Mon Dec 15 21:40:00 GMT 2003


[ Joel, I came across a message from you about the same problem from 2002 ]

When running the GDB testsuite on i386-pc-solaris2.9 I noticed that
GDB had some trouble locating static variables.  Turns out the native
x86 Solaris assembler doesn't emit relocations for stabs describing
these variables.  As a result the unrelocated value ends up in the
final executable, which simply doesn't point at the right location for
the variable.  It is needless to say that this makes debugging, well,
a challenge.

On SPARC everything seems to be all-right since the assembler *does*
emit the necessary relocations.

Possible solutions:

* Use GNU as.

* Let GCC emit a few extra symbols as described in:
  http://sources.redhat.com/gdb/current/onlinedocs/stabs_13.html#SEC89

* Make GCC emit DWARF2 debugging info on i386-pc-solaris2.9 by default.

Mark



More information about the Gdb mailing list