register names

Andrew Cagney cagney@gnu.org
Mon Jan 19 20:17:00 GMT 2004


> Hi,
> 	I am porting GDB for  a new target.
> I want to use register names and register numbers in XXX-tdep.c, So cant i
> use the defination from include/opcode/XXX.h, . Every taget has this
> information in this file(include/opcode/XXX.h), then why define it again in
> XXX-tdep.c file.

Historic, along with other factors.  There was a time when:

- the ordering was determined by GCCs debug info
vs
- the ordering determined the way registers were displayed
vs
- the ordering determines the remote protocol
vs
- the ordreing determines the sim interface

and consequently it was safer to wire down the ordering local to gdb and 
then just leave it.

However, for a brand new architecture with none of that baggage, having 
opcodes/ export a enumeration (and even a name table) looks much easier!

Andrew




More information about the Gdb mailing list