Commit | Line | Data |
---|---|---|
400943fb SC |
1 | #include <stdio.h> |
2 | #include "defs.h" | |
3 | ||
4 | /* an easy to debug H8 stack frame looks like: | |
5 | 0x6df2 push r2 | |
6 | 0x6df3 push r3 | |
7 | 0x6df6 push r6 | |
8 | 0x mov.w r7,r6 | |
9 | subs stuff,sp mov.w #x,r5 | |
10 | subs r5,sp | |
11 | ||
12 | */ | |
13 | #define IS_PUSH(x) ((x & 0xff00)==0x6d00) | |
14 | CORE_ADDR h8300_skip_prologue(start_pc) | |
15 | CORE_ADDR start_pc; | |
0a8f9d31 | 16 | |
0a8f9d31 | 17 | { |
400943fb SC |
18 | /* Skip past all push insns */ |
19 | short int w; | |
0a8f9d31 | 20 | |
400943fb SC |
21 | w = read_memory_integer(start_pc, 2); |
22 | while (IS_PUSH(w)) | |
23 | { | |
24 | start_pc+=2; | |
25 | w = read_memory_integer(start_pc, 2); | |
26 | } | |
27 | return start_pc; | |
0a8f9d31 SC |
28 | |
29 | } | |
30 | ||
31 | h8300_pop_frame() | |
32 | { | |
33 | printf("pop frame\n"); | |
34 | ||
35 | } | |
36 | ||
400943fb SC |
37 | int |
38 | print_insn(memaddr, stream) | |
39 | CORE_ADDR memaddr; | |
40 | FILE *stream; | |
0a8f9d31 | 41 | { |
400943fb SC |
42 | /* Nothing is bigger than 8 bytes */ |
43 | char data[8]; | |
44 | read_memory (memaddr, data, sizeof(data)); | |
45 | return print_insn_h8300(memaddr, data , stream); | |
46 | ||
47 | ||
0a8f9d31 | 48 | } |
400943fb SC |
49 | |
50 | ||
51 | ||
52 | FRAME_CHAIN() | |
53 | { | |
54 | ||
55 | printf("Frame chain\n"); | |
56 | ||
57 | } | |
58 | ||
59 |