From: Kevin Buettner Date: Tue, 11 Mar 2003 23:15:38 +0000 (+0000) Subject: * mips-tdep.c (mips_ecoff_reg_to_regnum): Rename to X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2f38ef8908b87f5ef39bb07676dfd550b7949a3f;p=binutils-gdb.git * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6ef2f400c4a..037fc7476ac 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,16 @@ +2003-03-11 Kevin Buettner + + * 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 * breakpoint.c (bpstat_stop_status): Fix a small memory leak. diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 7ade6a224ce..005e650190c 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);