Use 16-bit integer type for rl78 register pairs.
This patch changes rl78-tdep.c so that a 16-bit type is used for
register pairs instead of a pointer type as was previously the case.
This will cause these register pairs to be displayed as integers
instead of as a data address with a 0xf0000 ORed in.
E.g. registers ax, bc, de, and hl might now be displayed like this:
(gdb) info registers ax bc de hl
ax 0x6 6
bc 0x0 0
de 0x10c3 4291
hl 0x108d 423
Whereas, before, they were displayed as follows:
(gdb) info registers ax bc de hl
ax 0xf0006 0xf0006
bc 0xf0000 0xf0000
de 0xf10c3 0xf10c3
hl 0xf108d 0xf108d
These pairs are 16 bit quantities and should be displayed as such.
This change also affects the way that the banked register pairs are
displayed. Within GDB, the banked register pairs are named bank0_rp0,
bank0_rp1, .., bank3_rp2, bank3_rp3.
However, these register pairs need to be used as addresses in DWARF
expressions. I have added 16 pseudo registers corresponding to banked
register pairs. These new pseudo registers are all hidden from the
user and have a pointer type. Values from these registers are
intended to be used in DWARF expressions. Therefore,
rl78_dwarf_reg_to_regnum() has been adjusted to return these new
pseudo register numbers.
I had a much simpler patch which only changed the types, but it showed
a number of regressions due to integer values from the banked register
pairs being used as part of an address expression. This current patch
shows no regressions and now displays values of register pairs
correctly.
* rl78-tdep.c ( RL78_BANK0_RP0_PTR_REGNUM, RL78_BANK0_RP1_PTR_REGNUM)
(RL78_BANK0_RP2_PTR_REGNUM, RL78_BANK0_RP3_PTR_REGNUM)
(RL78_BANK1_RP0_PTR_REGNUM, RL78_BANK1_RP1_PTR_REGNUM)
(RL78_BANK1_RP2_PTR_REGNUM, RL78_BANK1_RP3_PTR_REGNUM)
(RL78_BANK2_RP0_PTR_REGNUM, RL78_BANK2_RP1_PTR_REGNUM)
(RL78_BANK2_RP2_PTR_REGNUM, RL78_BANK2_RP3_PTR_REGNUM)
(RL78_BANK3_RP0_PTR_REGNUM, RL78_BANK3_RP1_PTR_REGNUM)
(RL78_BANK3_RP2_PTR_REGNUM, RL78_BANK3_RP3_PTR_REGNUM):
New constants.
(rl78_register_type): Use a data pointer type for SP and
new pseudo registers mentioned above. Use a 16 bit integer
type for all other register pairs.
(rl78_register_name, rl78_g10_register_name): Update for
new pseudo registers.
(rl78_pseudo_register_read): Likewise.
(rl78_pseudo_register_write): Likewise.
(rl78_dwarf_reg_to_regnum): Return register numbers representing
to the newly added pseudo registers.