Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] More tweaks to arm_skip_prologue
@ 2002-04-22 17:05 Michael Snyder
  2002-04-23  2:44 ` Richard Earnshaw
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2002-04-22 17:05 UTC (permalink / raw)
  To: gdb-patches; +Cc: cagney, rearnsha


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]".

Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.51
diff -p -r1.51 arm-tdep.c
*** arm-tdep.c	22 Apr 2002 23:22:04 -0000	1.51
--- arm-tdep.c	23 Apr 2002 00:00:30 -0000
*************** arm_skip_prologue (CORE_ADDR pc)
*** 446,467 ****
       by disassembling the instructions. */
    skip_pc = pc;
    inst = read_memory_integer (skip_pc, 4);
!   if (inst != 0xe1a0c00d)	/* mov ip, sp */
!     return pc;
  
!   skip_pc += 4;
!   inst = read_memory_integer (skip_pc, 4);
!   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} */
!     return pc;
  
!   skip_pc += 4;
!   inst = read_memory_integer (skip_pc, 4);
  
    /* Any insns after this point may float into the code, if it makes
       for better instruction scheduling, so we skip them only if we
--- 446,475 ----
       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);
!     }
  
!   /* 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);
      }
  
!   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);
!     }
  
    /* Any insns after this point may float into the code, if it makes
       for better instruction scheduling, so we skip them only if we


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-04-24 21:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-22 17:05 [RFA] More tweaks to arm_skip_prologue Michael Snyder
2002-04-23  2:44 ` Richard Earnshaw
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox