Register variables in stabs

Mark Kettenis kettenis@wins.uva.nl
Mon Aug 20 16:17:00 GMT 2001


The run-time dynamic linker (/lib/ld-linux.so.2) on my systems
contains the following seemingly bogus stab (output from objdump
--stabs):

Symnum n_type n_othr n_desc n_value  n_strx String

2074   RSYM   0      1496   ffffffff 27890  buf:r(0,40)=*(0,41)=ar(0,1);0;-1;(0,2)

which means that buf is a pointer to an array of some type which lives
in register number 0xffffffff or -1.  Of course -1 isn't a valid
register number, and my recent register renumbering patches for the
i386 map this bogus number onto NUM_REGS + NUM_PSEUDO_REGS, which
forces GDB to complain about the symbol.  Before my change GDB would
keep the register number at -1 which resulted in no complaint.  My
question now is why the register number -1 is used.  Is this a
compiler bug, or has -1 a special meaning.

Depending on the answer to the question above: should we leave
negative register numbers alone (as GDB does for most other targets)
and not warn about them, or is it OK to complain?

Mark



More information about the Gdb mailing list