Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Richard.Earnshaw@arm.com
Cc: Michael Snyder <msnyder@cygnus.com>,
	gdb-patches@sources.redhat.com, rearnsha@arm.com
Subject: Re: [RFA] Arm/Thumb tweak for generic_dummy_frames
Date: Wed, 22 May 2002 22:01:00 -0000	[thread overview]
Message-ID: <3CEC0D7E.1060906@cygnus.com> (raw)
In-Reply-To: <200205220913.KAA18003@cam-mail2.cambridge.arm.com>

> 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






  reply	other threads:[~2002-05-22 21:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-21 18:45 Michael Snyder
2002-05-22  2:52 ` Richard Earnshaw
2002-05-22 22:01   ` Andrew Cagney [this message]
2002-05-23 14:21   ` Michael Snyder

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=3CEC0D7E.1060906@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=msnyder@cygnus.com \
    --cc=rearnsha@arm.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