This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] More tweaks to arm_skip_prologue
- From: Michael Snyder <msnyder at redhat dot com>
- To: Richard dot Earnshaw at arm dot com
- Cc: Michael Snyder <msnyder at cygnus dot com>, gdb-patches at sources dot redhat dot com, cagney at redhat dot com, rearnsha at arm dot com
- Date: Tue, 23 Apr 2002 10:42:56 -0700
- Subject: Re: [RFA] More tweaks to arm_skip_prologue
- Organization: Red Hat, Inc.
- References: <200204230943.KAA00581@cam-mail2.cambridge.arm.com>
Richard Earnshaw wrote:
>
> >
> > 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.
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.
>
> >
> > ! /* 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).
OK, I'll correct that.
> 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.