This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[rfa/ppc] Return the dummy frame's saved pc
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 24 Sep 2002 10:16:44 -0400
- Subject: [rfa/ppc] Return the dummy frame's saved pc
Hello,
The attached patch modifies rs6000_frame_saved_pc() so that when:
- a frame didn't save the PC (i.e., link register)
- the next inner most frame is a dummy
the dummy frame's link register is returned.
On a GNU/Linux PPC system (not sure which flavour but gcc is ``2.95.3''
:-), it fixes the following failures:
gdb.base/callfuncs.exp: backtrace after finish from nested call level 3
gdb.base/callfuncs.exp: backtrace after finish from nested call level 4
gdb.base/callfuncs.exp: backtrace at nested call level 2
gdb.base/callfuncs.exp: backtrace at nested call level 3
gdb.base/callfuncs.exp: backtrace at nested call level 4
Ok?
Andrew
2002-09-24 Andrew Cagney <ac131313@redhat.com>
* rs6000-tdep.c (rs6000_frame_saved_pc): If the link register
wasn't saved, and the next innermost frame is a dummy, return the
dummy frame's link register.
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.82
diff -u -r1.82 rs6000-tdep.c
--- rs6000-tdep.c 17 Sep 2002 20:42:01 -0000 1.82
+++ rs6000-tdep.c 24 Sep 2002 14:06:50 -0000
@@ -1527,6 +1527,16 @@
if (fi->next->signal_handler_caller)
return read_memory_addr (fi->next->frame + SIG_FRAME_LR_OFFSET,
wordsize);
+ else if (PC_IN_CALL_DUMMY (get_next_frame (fi)->pc, 0, 0))
+ /* The link register wasn't saved by this frame and the next
+ (inner, newer) frame is a dummy. Get the link register
+ value by unwinding it from that [dummy] frame. */
+ {
+ ULONGEST lr;
+ frame_unwind_unsigned_register (get_next_frame (fi),
+ tdep->ppc_lr_regnum, &lr);
+ return lr;
+ }
else
return read_memory_addr (FRAME_CHAIN (fi) + tdep->lr_frame_offset,
wordsize);