aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2012-03-01 22:52:03 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2012-03-01 22:52:03 +0000
commit9aac7884c5b42168641360fbdcedb2514a69797b (patch)
tree23b11b7b4eb7110884e3760f3319d944734ca4e6 /gdb
parent263689d88a2cbcedb42e925400e88f71ddb81698 (diff)
downloadgdb-9aac7884c5b42168641360fbdcedb2514a69797b.zip
gdb-9aac7884c5b42168641360fbdcedb2514a69797b.tar.gz
gdb-9aac7884c5b42168641360fbdcedb2514a69797b.tar.bz2
* mips-tdep.c (mips_gdbarch_init): Only set pc_regnum and
sp_regnum once the gdbarch_init_osabi hook has been called.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/mips-tdep.c12
2 files changed, 13 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 93b3c7b..8019bcc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2012-03-01 Maciej W. Rozycki <macro@codesourcery.com>
+ * mips-tdep.c (mips_gdbarch_init): Only set pc_regnum and
+ sp_regnum once the gdbarch_init_osabi hook has been called.
+
+2012-03-01 Maciej W. Rozycki <macro@codesourcery.com>
+
* mips-tdep.c (mips32_bc1_pc): New function.
(mips32_next_pc): Handle BC1ANY2F, BC1ANY2T, BC1ANY4F, BC1ANY4T,
BPOSGE32 and BPOSGE64 instructions.
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index bf396f9..1d0b54f 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -6418,10 +6418,6 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
regnum = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct mips_regnum);
*regnum = mips_regnum;
- /* FIXME: cagney/2003-11-15: For MIPS, hasn't gdbarch_pc_regnum been
- replaced by gdbarch_read_pc? */
- set_gdbarch_pc_regnum (gdbarch, regnum->pc + num_regs);
- set_gdbarch_sp_regnum (gdbarch, MIPS_SP_REGNUM + num_regs);
set_gdbarch_fp0_regnum (gdbarch, regnum->fp0);
set_gdbarch_num_regs (gdbarch, num_regs);
set_gdbarch_num_pseudo_regs (gdbarch, num_regs);
@@ -6650,6 +6646,14 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
info.tdep_info = (void *) tdesc_data;
gdbarch_init_osabi (info, gdbarch);
+ /* The hook may have adjusted num_regs, fetch the final value and
+ set pc_regnum and sp_regnum now that it has been fixed. */
+ /* FIXME: cagney/2003-11-15: For MIPS, hasn't gdbarch_pc_regnum been
+ replaced by gdbarch_read_pc? */
+ num_regs = gdbarch_num_regs (gdbarch);
+ set_gdbarch_pc_regnum (gdbarch, regnum->pc + num_regs);
+ set_gdbarch_sp_regnum (gdbarch, MIPS_SP_REGNUM + num_regs);
+
/* Unwind the frame. */
dwarf2_append_unwinders (gdbarch);
frame_unwind_append_unwinder (gdbarch, &mips_stub_frame_unwind);