diff options
author | Steve Chamberlain <sac@cygnus> | 1992-01-24 02:37:13 +0000 |
---|---|---|
committer | Steve Chamberlain <sac@cygnus> | 1992-01-24 02:37:13 +0000 |
commit | 400943fbac9324c093fb83c44c4d08d1fc770945 (patch) | |
tree | 16da467afdc7ddb9716d52c3e52f83a9f6e31cb3 /gdb/h8300-tdep.c | |
parent | 8174b2afcf1392e7abe31a3760ca61251b3e4681 (diff) | |
download | gdb-400943fbac9324c093fb83c44c4d08d1fc770945.zip gdb-400943fbac9324c093fb83c44c4d08d1fc770945.tar.gz gdb-400943fbac9324c093fb83c44c4d08d1fc770945.tar.bz2 |
One step closer.
Diffstat (limited to 'gdb/h8300-tdep.c')
-rw-r--r-- | gdb/h8300-tdep.c | 63 |
1 files changed, 45 insertions, 18 deletions
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 21dde42..50a0092 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -1,10 +1,30 @@ +#include <stdio.h> +#include "defs.h" + +/* an easy to debug H8 stack frame looks like: +0x6df2 push r2 +0x6df3 push r3 +0x6df6 push r6 +0x mov.w r7,r6 + subs stuff,sp mov.w #x,r5 + subs r5,sp + + */ +#define IS_PUSH(x) ((x & 0xff00)==0x6d00) +CORE_ADDR h8300_skip_prologue(start_pc) +CORE_ADDR start_pc; -h8300_skip_prologue() { + /* Skip past all push insns */ + short int w; - printf("skip prologue\n"); - - abort(); + w = read_memory_integer(start_pc, 2); + while (IS_PUSH(w)) + { + start_pc+=2; + w = read_memory_integer(start_pc, 2); + } +return start_pc; } @@ -14,19 +34,26 @@ h8300_pop_frame() } -print_insn() +int +print_insn(memaddr, stream) +CORE_ADDR memaddr; +FILE *stream; { - printf("print insn\n"); - + /* Nothing is bigger than 8 bytes */ + char data[8]; + read_memory (memaddr, data, sizeof(data)); + return print_insn_h8300(memaddr, data , stream); + + } - - - -FRAME_CHAIN() -{ - - printf("Frame chain\n"); - -} - - + + + + FRAME_CHAIN() + { + + printf("Frame chain\n"); + + } + + |