aboutsummaryrefslogtreecommitdiff
path: root/gdb/arm-tdep.c
diff options
context:
space:
mode:
authorJonathan Larmour <jifl@eCosCentric.com>2000-03-24 21:33:35 +0000
committerJonathan Larmour <jifl@eCosCentric.com>2000-03-24 21:33:35 +0000
commitc78858285bb60ac2031d4d68fe6d06190803231a (patch)
tree9c2bc1ec750be448207ef03e70d647b3a7ec9718 /gdb/arm-tdep.c
parentb4fe2683639c4ac8a5a53576d1c7e020b6b7d05e (diff)
downloadgdb-c78858285bb60ac2031d4d68fe6d06190803231a.zip
gdb-c78858285bb60ac2031d4d68fe6d06190803231a.tar.gz
gdb-c78858285bb60ac2031d4d68fe6d06190803231a.tar.bz2
* arm-tdep.c (thumb_skip_prologue): Take function end addr argument
so that we can stop searching for the prologue past the function end (arm_skip_prologue): Call thumb_skip_prologue with function end addr
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r--gdb/arm-tdep.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index eaaa19c..7112c4c 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -328,7 +328,7 @@ arm_frameless_function_invocation (struct frame_info *fi)
*/
static CORE_ADDR
-thumb_skip_prologue (CORE_ADDR pc)
+thumb_skip_prologue (CORE_ADDR pc, CORE_ADDR func_end)
{
CORE_ADDR current_pc;
int findmask = 0; /* findmask:
@@ -337,7 +337,7 @@ thumb_skip_prologue (CORE_ADDR pc)
bit 2 - sub sp, #simm OR add sp, #simm (adjusting of sp)
*/
- for (current_pc = pc; current_pc < pc + 40; current_pc += 2)
+ for (current_pc = pc; current_pc + 2 < func_end && current_pc < pc + 40; current_pc += 2)
{
unsigned short insn = read_memory_unsigned_integer (current_pc, 2);
@@ -399,7 +399,7 @@ arm_skip_prologue (CORE_ADDR pc)
/* Check if this is Thumb code. */
if (arm_pc_is_thumb (pc))
- return thumb_skip_prologue (pc);
+ return thumb_skip_prologue (pc, func_end);
/* Can't find the prologue end in the symbol table, try it the hard way
by disassembling the instructions. */