diff options
author | Randolph Chung <tausq@debian.org> | 2005-12-09 11:10:25 +0000 |
---|---|---|
committer | Randolph Chung <tausq@debian.org> | 2005-12-09 11:10:25 +0000 |
commit | 1ef7fcb5adf312dad7f75dff3a5f05c338b93b30 (patch) | |
tree | 5e9e17391b51367aa393b92aae8e6c4b7807ce3e | |
parent | 9fdb1f509e56d4408647c62e12ae0fc027f94a4b (diff) | |
download | gdb-1ef7fcb5adf312dad7f75dff3a5f05c338b93b30.zip gdb-1ef7fcb5adf312dad7f75dff3a5f05c338b93b30.tar.gz gdb-1ef7fcb5adf312dad7f75dff3a5f05c338b93b30.tar.bz2 |
2005-12-09 Randolph Chung <tausq@debian.org>
* hppa-tdep.c (hppa64_dwarf_reg_to_regnum): New funtion.
(hppa_gdbarch_init): Set dwarf_reg_to_regnum and
dwarf2_reg_to_regnum methods.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/hppa-tdep.c | 17 |
2 files changed, 23 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 175b222..44f8f48 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2005-12-09 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa64_dwarf_reg_to_regnum): New funtion. + (hppa_gdbarch_init): Set dwarf_reg_to_regnum and + dwarf2_reg_to_regnum methods. + 2005-12-08 Kevin Buettner <kevinb@redhat.com> * NEWS (Changes in GDB 6.4): Delete references indicating that diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 94de581..88eb1dc 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -662,6 +662,21 @@ hppa64_register_name (int i) return names[i]; } +static int +hppa64_dwarf_reg_to_regnum (int reg) +{ + /* r0-r31 and sar map one-to-one. */ + if (reg <= 32) + return reg; + + /* fr4-fr31 are mapped from 72 in steps of 2. */ + if (reg >= 72 || reg < 72 + 28 * 2) + return HPPA64_FP4_REGNUM + (reg - 72) / 2; + + error ("Invalid DWARF register num %d.", reg); + return -1; +} + /* This function pushes a stack frame with arguments as part of the inferior function calling mechanism. @@ -2747,6 +2762,8 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, hppa64_num_regs); set_gdbarch_register_name (gdbarch, hppa64_register_name); set_gdbarch_register_type (gdbarch, hppa64_register_type); + set_gdbarch_dwarf_reg_to_regnum (gdbarch, hppa64_dwarf_reg_to_regnum); + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, hppa64_dwarf_reg_to_regnum); set_gdbarch_cannot_store_register (gdbarch, hppa64_cannot_store_register); set_gdbarch_cannot_fetch_register (gdbarch, |