2 ** mrdb.h - mruby debugger
14 # define __func__ __FUNCTION__
17 #define MAX_COMMAND_WORD (16)
19 typedef enum debug_command_id {
35 DBGCMD_DELETE_DISPLAY,
44 typedef enum dbgcmd_state {
52 typedef enum mrdb_exemode {
60 typedef enum mrdb_exephase {
67 typedef enum mrdb_brkmode {
76 MRB_DEBUG_BPTYPE_NONE,
77 MRB_DEBUG_BPTYPE_LINE,
78 MRB_DEBUG_BPTYPE_METHOD,
83 struct mrb_debug_context;
85 typedef struct mrb_debug_linepoint {
88 } mrb_debug_linepoint;
90 typedef struct mrb_debug_methodpoint {
91 const char *class_name;
92 const char *method_name;
93 } mrb_debug_methodpoint;
95 typedef struct mrb_debug_breakpoint {
98 mrb_debug_bptype type;
100 mrb_debug_linepoint linepoint;
101 mrb_debug_methodpoint methodpoint;
103 } mrb_debug_breakpoint;
105 typedef struct mrb_debug_context {
106 struct mrb_irep *root_irep;
107 struct mrb_irep *irep;
116 mrdb_exephase xphase;
123 mrb_debug_breakpoint bp[MAX_BREAKPOINT];
127 int32_t stopped_bpno;
130 mrdb_exemode (*break_hook)(mrb_state *mrb, struct mrb_debug_context *dbg);
134 typedef struct mrdb_state {
138 char *words[MAX_COMMAND_WORD];
142 mrb_debug_context *dbg;
145 typedef dbgcmd_state (*debug_command_func)(mrb_state*, mrdb_state*);
148 dbgcmd_state dbgcmd_run(mrb_state*, mrdb_state*);
149 dbgcmd_state dbgcmd_continue(mrb_state*, mrdb_state*);
150 dbgcmd_state dbgcmd_step(mrb_state*, mrdb_state*);
151 dbgcmd_state dbgcmd_next(mrb_state*, mrdb_state*);
153 dbgcmd_state dbgcmd_break(mrb_state*, mrdb_state*);
154 dbgcmd_state dbgcmd_info_break(mrb_state*, mrdb_state*);
155 dbgcmd_state dbgcmd_info_local(mrb_state*, mrdb_state*);
156 dbgcmd_state dbgcmd_delete(mrb_state*, mrdb_state*);
157 dbgcmd_state dbgcmd_enable(mrb_state*, mrdb_state*);
158 dbgcmd_state dbgcmd_disable(mrb_state*, mrdb_state*);
160 dbgcmd_state dbgcmd_print(mrb_state*, mrdb_state*);
161 dbgcmd_state dbgcmd_eval(mrb_state*, mrdb_state*);
163 dbgcmd_state dbgcmd_list(mrb_state*, mrdb_state*);
164 dbgcmd_state dbgcmd_help(mrb_state*, mrdb_state*);
165 dbgcmd_state dbgcmd_quit(mrb_state*, mrdb_state*);