[RFA] Arm/Thumb tweak for generic_dummy_frames

Andrew Cagney ac131313@cygnus.com
Wed May 22 22:01:00 GMT 2002


> msnyder@cygnus.com said:
> 
>>  This is a corner case that Andrew missed when he did the transition
>> to generic dummy frames.
> 
> 
>> 2002-05-21  Michael Snyder  <msnyder@redhat.com>
> 
> 
>> 	* arm-tdep.c (arm_frame_chain): Recognize dummy-frame as a
>> 	special case that does not indicate a transition from arm
>> 	to thumb or vice versa. 
> 
> 
> I can't (easily) work out from this what was wrong, and how you've fixed 
> it.  Could you provide some more detailed analysis?  Why would a dummy 
> frame never involve a transition between ARM and Thumb state?

(I didn't really miss a corner case - the code was broken before/after 
the dummy frame conversion.  The results for thumb are different to arm 
though).

When you have an Arm v Thumb stack you see:

	Thumb-frame(Thumb FP) (callee)
	Arm-frame (Arm FP) (caller)

The function frame_chain(Thumb-frame) needs to return the frame-pointer 
for the calling Arm-frame.

To do this it first compares the caller and callee PC to check for a 
mode change.  If one occure the callers prologue is examined to 
determine which register was used for the FP and hence, which register 
of the oposite mode needs to be unwound to obtain the frame chain.

What it didn't handle was:

	Thumb-frame
	dummy-frame
	Arm-frame

in fact, it was even messing up

	Thumb-frame
	dummy-frame
	Thumb-frame

(and that is before my change :-)  The problem being that the 
dummy-frame's PC is assumed to be Arm (based on symbol and address 
analysis).

Michael's patch changes things to detect the presence of a dummy frame 
and then, for that case, assume the callee and caller are the same.  It 
doesn't help thumb dummy arm though (but the old code didn't appear to 
handle that case either).

enjoy,
Andrew







More information about the Gdb-patches mailing list