From: Andrew Cagney <ac131313@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [rfa/ppc] Return the dummy frame's saved pc
Date: Tue, 24 Sep 2002 07:16:00 -0000 [thread overview]
Message-ID: <3D9073CC.4010201@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 652 bytes --]
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
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 1132 bytes --]
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);
next reply other threads:[~2002-09-24 14:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-24 7:16 Andrew Cagney [this message]
2002-09-24 16:44 ` Kevin Buettner
2002-09-25 6:35 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D9073CC.4010201@redhat.com \
--to=ac131313@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox