Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@arm.com>
To: Michael Snyder <msnyder@cygnus.com>
Cc: gdb-patches@sources.redhat.com, cagney@redhat.com, rearnsha@arm.com
Subject: Re: [RFA] More tweaks to arm_skip_prologue
Date: Tue, 23 Apr 2002 02:44:00 -0000	[thread overview]
Message-ID: <200204230943.KAA00581@cam-mail2.cambridge.arm.com> (raw)
In-Reply-To: Your message of "Mon, 22 Apr 2002 16:53:10 PDT." <200204222353.g3MNrAD11515@reddwarf.sfbay.redhat.com>

> 
> I know that some of these tweaks to arm_skip_prologue will also
> suggest similar tweaks to arm_scan_prologue.  I'll do those next.
> Wouldn't it be nice if the two shared code?    ;-)
> 
> 2002-04-22  Michael Snyder  <msnyder@redhat.com>
> 
> 	* arm-tdep.c (arm_skip_prologue): Better handling for frameless 
> 	functions.  Treat "mov ip, sp" as optional.  Recognize 
> 	"str lr, [sp, #-nn]".
> 
In principal OK, but see embedded notes.

>        by disassembling the instructions. */
>     skip_pc = pc;
>     inst = read_memory_integer (skip_pc, 4);
> !   if (inst == 0xe1a0c00d)       /* mov ip, sp */
> !     {
> !       skip_pc += 4;
> !       inst = read_memory_integer (skip_pc, 4);
> !     }

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.

>   
> !   /* Some prologues begin with "str lr, [sp, #-nn]".  */
> !   if ((inst & 0xffffff00) == 0xe52de000)        /* str lr, [sp, #-nn] */
>       {
>         skip_pc += 4;
>         inst = read_memory_integer (skip_pc, 4);
>       }

This should only ever be "str lr, [sp, #-4]!" (note the writeback).  What 
about an "stmfd sp!, {...., lr}" (non-frame) prologue instruction.

>   
> !   if ((inst & 0xfffffff0) == 0xe92d0000)	/* stmfd sp!,{a1,a2,a3,a4}  */
> !     {
> !       skip_pc += 4;
> !       inst = read_memory_integer (skip_pc, 4);
> !     }
>   
> !   if ((inst & 0xfffff800) == 0xe92dd800)	/* stmfd sp!,{fp,ip,lr,pc} */
> !     {
> !       skip_pc += 4;
> !       inst = read_memory_integer (skip_pc, 4);
> !     }
>   

R.



  reply	other threads:[~2002-04-23  9:44 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 [this message]
2002-04-23 10:54   ` Michael Snyder
2002-04-24  2:16     ` Richard Earnshaw
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=200204230943.KAA00581@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 \
    /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