]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* mips-tdep.c (mips_stub_frame_cache): Correct the saved return
authorDaniel Jacobowitz <drow@false.org>
Wed, 19 Sep 2007 14:45:39 +0000 (14:45 +0000)
committerDaniel Jacobowitz <drow@false.org>
Wed, 19 Sep 2007 14:45:39 +0000 (14:45 +0000)
address register.  Correct the call to frame_id_build.
(mips_stub_frame_sniffer): Use the stub unwinder when the PC
is invalid.

gdb/ChangeLog
gdb/mips-tdep.c

index 516cc764e6b2feb5619dab876d9a96259176b77c..cd8491ba0d5ab9ae56d6be474e40dfdf750a00e5 100644 (file)
@@ -1,3 +1,10 @@
+2007-09-19  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * mips-tdep.c (mips_stub_frame_cache): Correct the saved return
+       address register.  Correct the call to frame_id_build.
+       (mips_stub_frame_sniffer): Use the stub unwinder when the PC
+       is invalid.
+
 2007-09-18  Joel Brobecker  <brobecker@adacore.com>
 
        * ia64-tdep.c (refine_prologue_limit): Make sure we don't scan
index acd4991102416650310223164c10b64f05829fec..ff816510848dfed1b599bbc6c46c6a0eba7dca78 100644 (file)
@@ -2174,14 +2174,15 @@ mips_stub_frame_cache (struct frame_info *next_frame, void **this_cache)
   /* The return address is in the link register.  */
   trad_frame_set_reg_realreg (this_trad_cache,
                              gdbarch_pc_regnum (current_gdbarch),
-                             MIPS_RA_REGNUM);
+                             (gdbarch_num_regs (current_gdbarch)
+                              + MIPS_RA_REGNUM));
 
   /* Frame ID, since it's a frameless / stackless function, no stack
      space is allocated and SP on entry is the current SP.  */
   pc = frame_pc_unwind (next_frame);
   find_pc_partial_function (pc, NULL, &start_addr, NULL);
   stack_addr = frame_unwind_register_signed (next_frame, MIPS_SP_REGNUM);
-  trad_frame_set_id (this_trad_cache, frame_id_build (start_addr, stack_addr));
+  trad_frame_set_id (this_trad_cache, frame_id_build (stack_addr, start_addr));
 
   /* Assume that the frame's base is the same as the
      stack-pointer.  */
@@ -2222,9 +2223,14 @@ static const struct frame_unwind mips_stub_frame_unwind =
 static const struct frame_unwind *
 mips_stub_frame_sniffer (struct frame_info *next_frame)
 {
+  gdb_byte dummy[4];
   struct obj_section *s;
   CORE_ADDR pc = frame_unwind_address_in_block (next_frame, NORMAL_FRAME);
 
+  /* Use the stub unwinder for unreadable code.  */
+  if (target_read_memory (frame_pc_unwind (next_frame), dummy, 4) != 0)
+    return &mips_stub_frame_unwind;
+
   if (in_plt_section (pc, NULL))
     return &mips_stub_frame_unwind;