aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2003-03-11 23:15:38 +0000
committerKevin Buettner <kevinb@redhat.com>2003-03-11 23:15:38 +0000
commit2f38ef8908b87f5ef39bb07676dfd550b7949a3f (patch)
tree394d766e8226ac9857e811355625f8676f1d4f25 /gdb
parent5acd598562b17ce6d3ffa00f309c17221cde7f64 (diff)
downloadgdb-2f38ef8908b87f5ef39bb07676dfd550b7949a3f.zip
gdb-2f38ef8908b87f5ef39bb07676dfd550b7949a3f.tar.gz
gdb-2f38ef8908b87f5ef39bb07676dfd550b7949a3f.tar.bz2
* mips-tdep.c (mips_ecoff_reg_to_regnum): Rename to
mips_dwarf_dwarf2_ecoff_reg_to_regnum(). (mips_dwarf_dwarf2_ecoff_reg_to_regnum, mips_stab_reg_to_regnum): Do range checks on register number obtained from debugging info. (mips_gdbarch_init): Call set_gdbarch_dwarf_reg_to_regnum() and set_gdbarch_dwarf2_reg_to_regnum(). Adjust call of set_gdbarch_ecoff_reg_to_regnum() to account for new name of mapping function. (do_fp_register_row): Fix typo which caused double type to be used when attempting to unpack a float.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog13
-rw-r--r--gdb/mips-tdep.c32
2 files changed, 37 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6ef2f40..037fc74 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,16 @@
+2003-03-11 Kevin Buettner <kevinb@redhat.com>
+
+ * mips-tdep.c (mips_ecoff_reg_to_regnum): Rename to
+ mips_dwarf_dwarf2_ecoff_reg_to_regnum().
+ (mips_dwarf_dwarf2_ecoff_reg_to_regnum, mips_stab_reg_to_regnum):
+ Do range checks on register number obtained from debugging info.
+ (mips_gdbarch_init): Call set_gdbarch_dwarf_reg_to_regnum() and
+ set_gdbarch_dwarf2_reg_to_regnum(). Adjust call of
+ set_gdbarch_ecoff_reg_to_regnum() to account for new name of
+ mapping function.
+ (do_fp_register_row): Fix typo which caused double type to be
+ used when attempting to unpack a float.
+
2003-03-11 J. Brobecker <brobecker@gnat.com>
* breakpoint.c (bpstat_stop_status): Fix a small memory leak.
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 7ade6a2..005e650 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -4150,7 +4150,7 @@ do_fp_register_row (int regnum)
{
/* Eight byte registers: print each one as float AND as double. */
mips_read_fp_register_single (regnum, raw_buffer);
- flt1 = unpack_double (mips_double_register_type (), raw_buffer, &inv1);
+ flt1 = unpack_double (mips_float_register_type (), raw_buffer, &inv1);
mips_read_fp_register_double (regnum, raw_buffer);
doub = unpack_double (mips_double_register_type (), raw_buffer, &inv3);
@@ -5546,23 +5546,37 @@ mips_saved_pc_after_call (struct frame_info *frame)
static int
mips_stab_reg_to_regnum (int num)
{
- if (num < 32)
+ if (num >= 0 && num < 32)
return num;
- else
+ else if (num >= 38 && num < 70)
return num + FP0_REGNUM - 38;
+ else
+ {
+ /* This will hopefully (eventually) provoke a warning. Should
+ we be calling complaint() here? */
+ return NUM_REGS + NUM_PSEUDO_REGS;
+ }
}
-/* Convert a ecoff register number to a gdb REGNUM */
+
+/* Convert a dwarf, dwarf2, or ecoff register number to a gdb REGNUM */
static int
-mips_ecoff_reg_to_regnum (int num)
+mips_dwarf_dwarf2_ecoff_reg_to_regnum (int num)
{
- if (num < 32)
+ if (num >= 0 && num < 32)
return num;
- else
+ else if (num >= 32 && num < 64)
return num + FP0_REGNUM - 32;
+ else
+ {
+ /* This will hopefully (eventually) provoke a warning. Should
+ we be calling complaint() here? */
+ return NUM_REGS + NUM_PSEUDO_REGS;
+ }
}
+
/* Convert an integer into an address. By first converting the value
into a pointer and then extracting it signed, the address is
guarenteed to be correctly sign extended. */
@@ -5979,7 +5993,9 @@ mips_gdbarch_init (struct gdbarch_info info,
/* Map debug register numbers onto internal register numbers. */
set_gdbarch_stab_reg_to_regnum (gdbarch, mips_stab_reg_to_regnum);
- set_gdbarch_ecoff_reg_to_regnum (gdbarch, mips_ecoff_reg_to_regnum);
+ set_gdbarch_ecoff_reg_to_regnum (gdbarch, mips_dwarf_dwarf2_ecoff_reg_to_regnum);
+ set_gdbarch_dwarf_reg_to_regnum (gdbarch, mips_dwarf_dwarf2_ecoff_reg_to_regnum);
+ set_gdbarch_dwarf2_reg_to_regnum (gdbarch, mips_dwarf_dwarf2_ecoff_reg_to_regnum);
/* Initialize a frame */
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, mips_frame_init_saved_regs);