* [rfa/ppc] Return the dummy frame's saved pc
@ 2002-09-24 7:16 Andrew Cagney
2002-09-24 16:44 ` Kevin Buettner
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2002-09-24 7:16 UTC (permalink / raw)
To: gdb-patches
[-- 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);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [rfa/ppc] Return the dummy frame's saved pc
2002-09-24 7:16 [rfa/ppc] Return the dummy frame's saved pc Andrew Cagney
@ 2002-09-24 16:44 ` Kevin Buettner
2002-09-25 6:35 ` Andrew Cagney
0 siblings, 1 reply; 3+ messages in thread
From: Kevin Buettner @ 2002-09-24 16:44 UTC (permalink / raw)
To: Andrew Cagney, gdb-patches
On Sep 24, 10:16am, Andrew Cagney wrote:
> 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.
Okay.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [rfa/ppc] Return the dummy frame's saved pc
2002-09-24 16:44 ` Kevin Buettner
@ 2002-09-25 6:35 ` Andrew Cagney
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Cagney @ 2002-09-25 6:35 UTC (permalink / raw)
To: Kevin Buettner; +Cc: gdb-patches
> On Sep 24, 10:16am, Andrew Cagney wrote:
>
>
>> 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.
>
>
> Okay.
Done.
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-09-25 13:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-24 7:16 [rfa/ppc] Return the dummy frame's saved pc Andrew Cagney
2002-09-24 16:44 ` Kevin Buettner
2002-09-25 6:35 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox