annotate debug.h @ 2138:b6338e18787e

Fix some dynarec code invalidation issues
author Michael Pavone <pavone@retrodev.com>
date Sat, 19 Mar 2022 15:50:45 -0700
parents f80c6111e1ae
children 8c28c5466d70
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
524
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1 #ifndef DEBUG_H_
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
2 #define DEBUG_H_
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
3
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
4 #include <stdint.h>
569
9b7fcf748be0 Rename x86_68k_options and m68k_to_x86.h to m68k_options and m68k_core.h respectively
Michael Pavone <pavone@retrodev.com>
parents: 524
diff changeset
5 #include "m68k_core.h"
1752
d6d4c006a7b3 Initial attempt at interrupts in new Z80 core and integrating it into main executable
Michael Pavone <pavone@retrodev.com>
parents: 1329
diff changeset
6 #ifdef NEW_CORE
d6d4c006a7b3 Initial attempt at interrupts in new Z80 core and integrating it into main executable
Michael Pavone <pavone@retrodev.com>
parents: 1329
diff changeset
7 #include "z80.h"
d6d4c006a7b3 Initial attempt at interrupts in new Z80 core and integrating it into main executable
Michael Pavone <pavone@retrodev.com>
parents: 1329
diff changeset
8 #else
1129
6b5c92b6205c Enabled Z80 debugger in PBC mode
Michael Pavone <pavone@retrodev.com>
parents: 829
diff changeset
9 #include "z80_to_x86.h"
1752
d6d4c006a7b3 Initial attempt at interrupts in new Z80 core and integrating it into main executable
Michael Pavone <pavone@retrodev.com>
parents: 1329
diff changeset
10 #endif
524
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
11
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
12 typedef struct disp_def {
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
13 struct disp_def * next;
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
14 char * param;
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
15 uint32_t index;
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
16 char format_char;
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
17 } disp_def;
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
18
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
19 typedef struct bp_def {
829
cc05444a4a4e WIP debugger improvements. Partial support for display command in 68K debugger. Minor refactor to support commands on a breakpoint.
Michael Pavone <pavone@retrodev.com>
parents: 569
diff changeset
20 struct bp_def *next;
cc05444a4a4e WIP debugger improvements. Partial support for display command in 68K debugger. Minor refactor to support commands on a breakpoint.
Michael Pavone <pavone@retrodev.com>
parents: 569
diff changeset
21 char *commands;
cc05444a4a4e WIP debugger improvements. Partial support for display command in 68K debugger. Minor refactor to support commands on a breakpoint.
Michael Pavone <pavone@retrodev.com>
parents: 569
diff changeset
22 uint32_t address;
cc05444a4a4e WIP debugger improvements. Partial support for display command in 68K debugger. Minor refactor to support commands on a breakpoint.
Michael Pavone <pavone@retrodev.com>
parents: 569
diff changeset
23 uint32_t index;
524
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
24 } bp_def;
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
25
2107
f80c6111e1ae Move some debugger state to a per-CPU structure. Add m command for returning to main CPU from sub CPU
Michael Pavone <pavone@retrodev.com>
parents: 1921
diff changeset
26 typedef struct {
f80c6111e1ae Move some debugger state to a per-CPU structure. Add m command for returning to main CPU from sub CPU
Michael Pavone <pavone@retrodev.com>
parents: 1921
diff changeset
27 void *cpu_context;
f80c6111e1ae Move some debugger state to a per-CPU structure. Add m command for returning to main CPU from sub CPU
Michael Pavone <pavone@retrodev.com>
parents: 1921
diff changeset
28 bp_def *breakpoints;
f80c6111e1ae Move some debugger state to a per-CPU structure. Add m command for returning to main CPU from sub CPU
Michael Pavone <pavone@retrodev.com>
parents: 1921
diff changeset
29 disp_def *displays;
f80c6111e1ae Move some debugger state to a per-CPU structure. Add m command for returning to main CPU from sub CPU
Michael Pavone <pavone@retrodev.com>
parents: 1921
diff changeset
30 uint32_t bp_index;
f80c6111e1ae Move some debugger state to a per-CPU structure. Add m command for returning to main CPU from sub CPU
Michael Pavone <pavone@retrodev.com>
parents: 1921
diff changeset
31 uint32_t disp_index;
f80c6111e1ae Move some debugger state to a per-CPU structure. Add m command for returning to main CPU from sub CPU
Michael Pavone <pavone@retrodev.com>
parents: 1921
diff changeset
32 uint32_t branch_t;
f80c6111e1ae Move some debugger state to a per-CPU structure. Add m command for returning to main CPU from sub CPU
Michael Pavone <pavone@retrodev.com>
parents: 1921
diff changeset
33 uint32_t branch_f;
f80c6111e1ae Move some debugger state to a per-CPU structure. Add m command for returning to main CPU from sub CPU
Michael Pavone <pavone@retrodev.com>
parents: 1921
diff changeset
34 } debug_root;
f80c6111e1ae Move some debugger state to a per-CPU structure. Add m command for returning to main CPU from sub CPU
Michael Pavone <pavone@retrodev.com>
parents: 1921
diff changeset
35
f80c6111e1ae Move some debugger state to a per-CPU structure. Add m command for returning to main CPU from sub CPU
Michael Pavone <pavone@retrodev.com>
parents: 1921
diff changeset
36 debug_root *find_root(void *cpu);
524
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
37 bp_def ** find_breakpoint(bp_def ** cur, uint32_t address);
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
38 bp_def ** find_breakpoint_idx(bp_def ** cur, uint32_t index);
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
39 void add_display(disp_def ** head, uint32_t *index, char format_char, char * param);
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
40 void remove_display(disp_def ** head, uint32_t index);
1329
85a90964b557 Fix interaction between 68K debugger and instruction retranslation due to self modifying code or bank switching
Michael Pavone <pavone@retrodev.com>
parents: 1129
diff changeset
41 void debugger(m68k_context * context, uint32_t address);
1129
6b5c92b6205c Enabled Z80 debugger in PBC mode
Michael Pavone <pavone@retrodev.com>
parents: 829
diff changeset
42 z80_context * zdebugger(z80_context * context, uint16_t address);
1921
5d028088e320 Added help commands to debugger
Eric Fry <yuv422@users.noreply.github.com>
parents: 1752
diff changeset
43 void print_m68k_help();
5d028088e320 Added help commands to debugger
Eric Fry <yuv422@users.noreply.github.com>
parents: 1752
diff changeset
44 void print_z80_help();
524
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
45
fb39534b6604 Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
46 #endif //DEBUG_H_