Trouble with dbx on a SPARC
gnu at toad.com
gnu at toad.com
Tue Mar 19 03:28:00 AEST 1991
The Sun C compiler before SunOS 4.1 would output incorrect debug
information about parameters shorter than an "int". The debug information
claimed that the parameter was a short at offset XXX. However the
parameter really was an int at offset XXX. If you wanted to treat it like
a short, you would have to look at offset XXX+2.
DBX apparently was able to deal with that somehow, and a kludge was added
to gdb to also deal with it.
They fixed the compiler in SunOS 4.1, so it now claims the short parameter
is at offset XXX+2, where it really is.
Perhaps DBX was not changed correspondingly.
GDB can be changed to handle this by defining BELIEVE_PCC_PROMOTION in the
config file (m-sun*.h). I changed GDB to handle both 4.0.x and 4.1 by
offsetting the symbol if it points at an int-aligned location, and leaving
it alone if it appears to have already been offset to where the parameter
really is. This lets you run the same GDB binary on SunOS 4.0.x and 4.1
machines. The change (in dbxread.c) will be in some future GDB release.
John Gilmore
More information about the Comp.sys.sun
mailing list