[RFA] arm_scan_prologue: accept strh and strb as well as str

Michael Snyder
2002-04-26T01:30:42Z

Hi Richard,

These are for char and short args, respectively.
The more I play with it, the more I want to merge
arm_scan and arm_skip into one function. ;-)

Michael

2002-04-25 Michael Snyder <msnyder@redhat.com>

* arm-tdep.c (arm_scan_prologue): Accept strb r(0123),[r11,#-nn]
and strh r(0123),[r11,#-nn] as well as str r(0123),[r11,#-nn].
(arm_skip_prologue): Ditto.

Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.55
diff -c -3 -p -r1.55 arm-tdep.c
*** arm-tdep.c 24 Apr 2002 21:22:06 -0000 1.55
--- arm-tdep.c 26 Apr 2002 01:28:12 -0000
*************** arm_skip_prologue (CORE_ADDR pc)
*** 468,474 ****
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);
--- 468,474 ----
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);
*************** arm_skip_prologue (CORE_ADDR pc)
*** 507,513 ****
inst = read_memory_integer (skip_pc, 4);
}

! while ((inst & 0xffffcfc0) == 0xe50b0000) /* str r(0123), [r11, #-nn] */
{
skip_pc += 4;
inst = read_memory_integer (skip_pc, 4);
--- 507,515 ----
inst = read_memory_integer (skip_pc, 4);
}

! while ((inst & 0xffffcfff) == 0xe54b0000 || /* strb r(0123),[r11,#-nn] */
! (inst & 0xffffc0f0) == 0xe14b00b0 || /* strh r(0123),[r11,#-nn] */
! (inst & 0xffffcfc0) == 0xe50b0000) /* str r(0123),[r11,#-nn] */
{
skip_pc += 4;
inst = read_memory_integer (skip_pc, 4);
*************** arm_scan_prologue (struct frame_info *fi
*** 905,911 ****
fi->saved_regs[regno] = sp_offset;
}
}
! else if ((insn & 0xffffcfc0) == 0xe50b0000) /* str rx, [r11, -n] */
{
/* No need to add this to saved_regs -- it's just an arg reg. */
continue;
--- 907,915 ----
fi->saved_regs[regno] = sp_offset;
}
}
! else if ((insn & 0xffffcfff) == 0xe54b0000 || /* strb rx,[r11,#-n] */
! (insn & 0xffffc0f0) == 0xe14b00b0 || /* strh rx,[r11,#-n] */
! (insn & 0xffffcfc0) == 0xe50b0000) /* str rx,[r11,#-n] */
{
/* No need to add this to saved_regs -- it's just an arg reg. */
continue;