aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Anglin <dave.anglin@nrc.ca>2008-09-15 01:56:31 +0000
committerDave Anglin <dave.anglin@nrc.ca>2008-09-15 01:56:31 +0000
commit85c83e9940455e2c6ab318afa35a4a9d11b0a6cf (patch)
tree84e0273924301692b44a61e2c91aa3dcfb94f773
parent76815b175e99f4edaeedf355839875661088fcbe (diff)
downloadgdb-85c83e9940455e2c6ab318afa35a4a9d11b0a6cf.zip
gdb-85c83e9940455e2c6ab318afa35a4a9d11b0a6cf.tar.gz
gdb-85c83e9940455e2c6ab318afa35a4a9d11b0a6cf.tar.bz2
* 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/ChangeLog10
-rw-r--r--gdb/hppa-linux-tdep.c24
-rw-r--r--gdb/hppa-tdep.c7
3 files changed, 22 insertions, 19 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index edce9ae..00619d7 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 2cc591c..2c91441 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 cd844e82..5b6676e 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;
}