diff options
author | Dave Anglin <dave.anglin@nrc.ca> | 2008-09-15 01:56:31 +0000 |
---|---|---|
committer | Dave Anglin <dave.anglin@nrc.ca> | 2008-09-15 01:56:31 +0000 |
commit | 410fd7ce049b6c6f43d2eaee9e0a87617849b82c (patch) | |
tree | 8ada13264f092972af9f16d1a41bc1de70be2912 | |
parent | a422fc19106ce5eb4e080e47df4de567d4c90e5b (diff) | |
download | gdb-410fd7ce049b6c6f43d2eaee9e0a87617849b82c.tar.gz |
* hppa-linux-tdep.c (hppa_dwarf_reg_to_regnum): Remove surrounding
"#if 0" "#endif". Fix mapping of DWARF DBX registers to GDB registers.
Correct arguments and improve comments.
(hppa_linux_init_abi): Call set_gdbarch_dwarf2_reg_to_regnum. Delete
disabled code.
* hppa-tdep.c (hppa64_dwarf_reg_to_regnum): Fix check for floating
point DBX register, change error to warning, and improve comments.
-rw-r--r-- | gdb/ChangeLog | 10 | ||||
-rw-r--r-- | gdb/hppa-linux-tdep.c | 24 | ||||
-rw-r--r-- | gdb/hppa-tdep.c | 7 |
3 files changed, 22 insertions, 19 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index edce9ae1d36..00619d720f0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2008-09-14 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + + * hppa-linux-tdep.c (hppa_dwarf_reg_to_regnum): Remove surrounding + "#if 0" "#endif". Fix mapping of DWARF DBX registers to GDB registers. + Correct arguments and improve comments. + (hppa_linux_init_abi): Call set_gdbarch_dwarf2_reg_to_regnum. Delete + disabled code. + * hppa-tdep.c (hppa64_dwarf_reg_to_regnum): Fix check for floating + point DBX register, change error to warning, and improve comments. + 2008-09-14 Doug Evans <dje@google.com> * dwarf2read.c (struct die_info): Make members tag, num_attrs 16 bits. diff --git a/gdb/hppa-linux-tdep.c b/gdb/hppa-linux-tdep.c index 2cc591c0f89..2c91441d1fa 100644 --- a/gdb/hppa-linux-tdep.c +++ b/gdb/hppa-linux-tdep.c @@ -34,24 +34,21 @@ #include "elf/common.h" -#if 0 -/* Convert DWARF register number REG to the appropriate register - number used by GDB. */ +/* Map DWARF DBX register numbers to GDB register numbers. */ static int -hppa_dwarf_reg_to_regnum (int reg) +hppa_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg) { - /* registers 0 - 31 are the same in both sets */ - if (reg < 32) + /* The general registers and the sar are the same in both sets. */ + if (reg <= 32) return reg; - /* dwarf regs 32 to 85 are fpregs 4 - 31 */ - if (reg >= 32 && reg <= 85) - return HPPA_FP4_REGNUM + (reg - 32); + /* fr4-fr31 (left and right halves) are mapped from 72. */ + if (reg >= 72 && reg <= 72 + 28 * 2) + return HPPA_FP4_REGNUM + (reg - 72); - warning (_("Unmapped DWARF Register #%d encountered."), reg); + warning (_("Unmapped DWARF DBX Register #%d encountered."), reg); return -1; } -#endif static void hppa_linux_target_write_pc (struct regcache *regcache, CORE_ADDR v) @@ -545,12 +542,7 @@ hppa_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_regset_from_core_section (gdbarch, hppa_linux_regset_from_core_section); -#if 0 - /* Dwarf-2 unwinding support. Not yet working. */ set_gdbarch_dwarf2_reg_to_regnum (gdbarch, hppa_dwarf_reg_to_regnum); - frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer); - frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer); -#endif /* Enable TLS support. */ set_gdbarch_fetch_tls_load_module_address (gdbarch, diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index cd844e820d6..5b6676e0c6f 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -658,18 +658,19 @@ hppa64_register_name (struct gdbarch *gdbarch, int i) return names[i]; } +/* Map dwarf DBX register numbers to GDB register numbers. */ static int hppa64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg) { - /* r0-r31 and sar map one-to-one. */ + /* The general registers and the sar are the same in both sets. */ if (reg <= 32) return reg; /* fr4-fr31 are mapped from 72 in steps of 2. */ - if (reg >= 72 || reg < 72 + 28 * 2) + if (reg >= 72 && reg < 72 + 28 * 2 && !(reg & 1)) return HPPA64_FP4_REGNUM + (reg - 72) / 2; - error ("Invalid DWARF register num %d.", reg); + warning (_("Unmapped DWARF DBX Register #%d encountered."), reg); return -1; } |