Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@arm.com>
To: Michael Snyder <msnyder@redhat.com>
Cc: Richard.Earnshaw@arm.com, Michael Snyder <msnyder@cygnus.com>,
	gdb-patches@sources.redhat.com, cagney@redhat.com,
	rearnsha@arm.com
Subject: Re: [RFA] More tweaks to arm_skip_prologue
Date: Wed, 24 Apr 2002 02:16:00 -0000	[thread overview]
Message-ID: <200204240915.KAA25848@cam-mail2.cambridge.arm.com> (raw)
In-Reply-To: Your message of "Tue, 23 Apr 2002 10:42:56 PDT." <3CC59D20.D9D1A0CA@redhat.com>


> > If the sequence doesn't start with mov ip, sp then we either have a
> > scheduled prologue where the first instruction is messing with
> > call-clobbered register, or we have a frameless prologue.  I suspect that
> > if are in this situation then we should use a different unwind function to
> > keep things simpler.
> 
> You know way more about the architecture than I do, but
> check arm_scan_prologue -- it already does the same thing.
> I'd like to bring them into sync, and then think about
> possibly making them smarter.
> 

I was thinking more along the lines of (in pseudo code)

	arm_skip_prologue (...)
	{
	  if (first_instruction == "mov ip, lr")
	    skip_atpcs_frame_prologue (...)
	  else
	    skip_prologue_maybe_frameless (...)

Maybe we could even make the sub-functions common to the two existing uses.


> > What about an "stmfd sp!, {...., lr}" (non-frame) prologue instruction.
> 
> Can you give me a pattern to match for?
> I haven't actually seen that instruction in a prologue.

Try compiling the following with -O2 -fomit-frame-pointer.

void f (int *);
void h (int);
void g (int a, int b)
{
  f(&a);
  h(b);
}

You should get something like:

_g:
        stmfd   sp!, {r4, lr}  @ Prologue
        sub     sp, sp, #4     @ Prologue
        str     r0, [sp, #0]   @ Prologue
        mov     r4, r1         @ [note 1]
        mov     r0, sp
        bl      _f
        mov     r0, r4
        bl      _h
        add     sp, sp, #4
        ldmfd   sp!, {r4, pc}

[1]  We should probably consider this instruction as part of the prologue 
as well, but it isn't clear we can detect this reliably (ie not get any 
false positives).  It's possible that we could switch on any mov from 
r0-r3.

R.


  reply	other threads:[~2002-04-24  9:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-22 17:05 Michael Snyder
2002-04-23  2:44 ` Richard Earnshaw
2002-04-23 10:54   ` Michael Snyder
2002-04-24  2:16     ` Richard Earnshaw [this message]
2002-04-23 16:00   ` Michael Snyder
2002-04-24  2:23     ` Richard Earnshaw
2002-04-24 11:47       ` Michael Snyder
2002-04-24 14:23       ` 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=200204240915.KAA25848@cam-mail2.cambridge.arm.com \
    --to=rearnsha@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=cagney@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=msnyder@cygnus.com \
    --cc=msnyder@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