[patch/rfa:rs6000] Don't use ->prev

Andrew Cagney ac131313@cygnus.com
Sun Apr 14 09:52:00 GMT 2002


Hello,

A number of targets contained code that tested ``->prev'' as part of 
doing their frame analysis.  I think this ``cheating''.  The objective 
of the frame analysis code is to create the ->prev frame using 
information from the current frame, not to use the still being created 
->prev frame :-)

Two cases - frame_chain for z8k and s390 - were, I think, simply wrong. 
  The deleted z8k comment is telling - someone was 180 degrees out! :-)

The other two cases - get_saved_regs for SPARC and rs6000 - are more 
interesting.

The SPARC code clearly relies on there already being a ->prev frame so 
I've used get_prev_frame().  Since ->prev must exist, there is no risk 
of recursion - get_prev_frame() calling get_saved_regs() (yes, grotty).

The rs6000 has me puzzled. I think the ->frame contains the address of 
the wrong end of the frame!  If ->frame pointed at the frame's start, 
the code below wouldn't even be needed.  Anyway, I've changed it to use 
frame_chain() (I don't see regressions on NetBSD/PPC.  The other 
possability would be to risk a (recursive) get_prev_frame() call.

Anyway, is the rs6000 ok?

Andrew
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20020414/665cf842/attachment.ksh>


More information about the Gdb-patches mailing list