This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Info reg sp


Thanks for your response.

> -----Original Message-----
> From: Daniel Jacobowitz [mailto:drow@false.org] 
> Sent: 22 May 2007 16:34
>
> Hmm, good question.  I could make an argument either way.  
> Every port has this same problem, but then again only the 
> default print_registers_info and those with their own 
> print_registers_info would have to be fixed.

The default print_registers seems to be immune to this by virtue of the
(slightly weird) for loop which compares every number less than
NUM_REGS+NUM_PSEUDO_REGS to regnum when printing a value! Design or
happy coincidence -- who can tell? 
 
> Still, it's nasty that value_of_register can handle user 
> registers but nothing else can.  Maybe frame.c should also?
> 
> I've been starting to use user registers more heavily lately, 
> since pseudo registers have strange problems - they only come 
> from a regcache, not from a frame.

I'm not clear on the meaning of PSEUDO_REGS vs. user regs but it seems
that if something like this can happen it should at least be documented.
There isn't currently any documentation on the meaning of
print_registers_info in gdbarch.sh, where I would expect to find it, but
the following found in infcmd.c doesn't mention this possibility:

/* Print out the machine register regnum. If regnum is -1, print all
   registers (print_all == 1) or all non-float and non-vector
   registers (print_all == 0).

   For most machines, having all_registers_info() print the
   register(s) one per line is good enough.  If a different format is
   required, (eg, for MIPS or Pyramid 90x, which both have lots of
   regs), or there is an existing convention for showing all the
   registers, define the architecture method PRINT_REGISTERS_INFO to
   provide that format.  */

Cheers,
 
Robert


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]