aboutsummaryrefslogtreecommitdiff
path: root/gdb/m68hc11-tdep.c
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2001-05-20 11:53:42 +0000
committerStephane Carrez <stcarrez@nerim.fr>2001-05-20 11:53:42 +0000
commitb4fa4770b8c2145ec040cb87ead3bd467cb4fa7b (patch)
tree57f3aa257371dc7f94a6da81e4655bee9c0ef0cf /gdb/m68hc11-tdep.c
parent2b127877435ec6b5f994e5e8e1ea0edc11094a59 (diff)
downloadgdb-b4fa4770b8c2145ec040cb87ead3bd467cb4fa7b.zip
gdb-b4fa4770b8c2145ec040cb87ead3bd467cb4fa7b.tar.gz
gdb-b4fa4770b8c2145ec040cb87ead3bd467cb4fa7b.tar.bz2
* m68hc11-tdep.c (m68hc11_pop_frame): Fix stack pointer computation.
(m68hc11_analyze_instruction): Update the pc correctly. (m68hc11_guess_from_prologue): Take into account the stack correction for the saving address.
Diffstat (limited to 'gdb/m68hc11-tdep.c')
-rw-r--r--gdb/m68hc11-tdep.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index a636b34..863dc90 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -334,7 +334,7 @@ m68hc11_pop_frame (void)
read_memory_integer (frame->saved_regs[regnum], 2));
write_register (HARD_PC_REGNUM, frame->extra_info->return_pc);
- sp = fp + frame->extra_info->size;
+ sp = (fp + frame->extra_info->size + 2) & 0x0ffff;
write_register (HARD_SP_REGNUM, sp);
}
flush_cached_frames ();
@@ -489,10 +489,12 @@ m68hc11_analyze_instruction (struct insn_sequence *seq, CORE_ADDR *pc,
v = read_memory_unsigned_integer (*pc + j + 1, 1);
if (buffer[j] & 1)
v |= 0xff00;
+ *pc = *pc + 1;
}
else if (buffer[j] == 0xf2)
{
v = read_memory_unsigned_integer (*pc + j + 1, 2);
+ *pc = *pc + 2;
}
cur_val = v;
break;
@@ -587,7 +589,7 @@ m68hc11_guess_from_prologue (CORE_ADDR pc, CORE_ADDR fp,
func_end = pc + 128;
found_frame_point = 0;
*frame_offset = 0;
- save_addr = fp;
+ save_addr = fp + STACK_CORRECTION;
while (!done && pc + 2 < func_end)
{
struct insn_sequence *seq;