source: EcnlProtoTool/trunk/mruby-1.3.0/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.h@ 331

Last change on this file since 331 was 331, checked in by coas-nagasima, 6 years ago

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 3.3 KB
Line 
1/*
2** mrdb.h - mruby debugger
3**
4*/
5
6#ifndef MRDB_H
7#define MRDB_H
8
9#include <mruby.h>
10
11#include "mrdbconf.h"
12
13#ifdef _MSC_VER
14# define __func__ __FUNCTION__
15#endif
16
17#define MAX_COMMAND_WORD (16)
18
19typedef enum debug_command_id {
20 DBGCMD_RUN,
21 DBGCMD_CONTINUE,
22 DBGCMD_NEXT,
23 DBGCMD_STEP,
24 DBGCMD_BREAK,
25 DBGCMD_INFO_BREAK,
26 DBGCMD_WATCH,
27 DBGCMD_INFO_WATCH,
28 DBGCMD_ENABLE,
29 DBGCMD_DISABLE,
30 DBGCMD_DELETE,
31 DBGCMD_PRINT,
32 DBGCMD_DISPLAY,
33 DBGCMD_INFO_DISPLAY,
34 DBGCMD_DELETE_DISPLAY,
35 DBGCMD_EVAL,
36 DBGCMD_BACKTRACE,
37 DBGCMD_LIST,
38 DBGCMD_HELP,
39 DBGCMD_QUIT,
40 DBGCMD_UNKNOWN
41} debug_command_id;
42
43typedef enum dbgcmd_state {
44 DBGST_CONTINUE,
45 DBGST_PROMPT,
46 DBGST_COMMAND_ERROR,
47 DBGST_MAX,
48 DBGST_RESTART
49} dbgcmd_state;
50
51typedef enum mrdb_exemode {
52 DBG_INIT,
53 DBG_RUN,
54 DBG_STEP,
55 DBG_NEXT,
56 DBG_QUIT,
57} mrdb_exemode;
58
59typedef enum mrdb_exephase {
60 DBG_PHASE_BEFORE_RUN,
61 DBG_PHASE_RUNNING,
62 DBG_PHASE_AFTER_RUN,
63 DBG_PHASE_RESTART,
64} mrdb_exephase;
65
66typedef enum mrdb_brkmode {
67 BRK_INIT,
68 BRK_BREAK,
69 BRK_STEP,
70 BRK_NEXT,
71 BRK_QUIT,
72} mrdb_brkmode;
73
74typedef enum {
75 MRB_DEBUG_BPTYPE_NONE,
76 MRB_DEBUG_BPTYPE_LINE,
77 MRB_DEBUG_BPTYPE_METHOD,
78} mrb_debug_bptype;
79
80struct mrb_irep;
81struct mrbc_context;
82struct mrb_debug_context;
83
84typedef struct mrb_debug_linepoint {
85 const char *file;
86 uint16_t lineno;
87} mrb_debug_linepoint;
88
89typedef struct mrb_debug_methodpoint {
90 const char *class_name;
91 const char *method_name;
92} mrb_debug_methodpoint;
93
94typedef struct mrb_debug_breakpoint {
95 uint32_t bpno;
96 uint8_t enable;
97 mrb_debug_bptype type;
98 union point {
99 mrb_debug_linepoint linepoint;
100 mrb_debug_methodpoint methodpoint;
101 } point;
102} mrb_debug_breakpoint;
103
104typedef struct mrb_debug_context {
105 struct mrb_irep *root_irep;
106 struct mrb_irep *irep;
107 mrb_code *pc;
108 mrb_value *regs;
109
110 const char *prvfile;
111 int32_t prvline;
112 mrb_callinfo *prvci;
113
114 mrdb_exemode xm;
115 mrdb_exephase xphase;
116 mrdb_brkmode bm;
117 int16_t bmi;
118
119 uint16_t ccnt;
120 uint16_t scnt;
121
122 mrb_debug_breakpoint bp[MAX_BREAKPOINT];
123 uint32_t bpnum;
124 int32_t next_bpno;
125 int32_t method_bpno;
126 int32_t stopped_bpno;
127 mrb_bool isCfunc;
128
129 mrdb_exemode (*break_hook)(mrb_state *mrb, struct mrb_debug_context *dbg);
130
131} mrb_debug_context;
132
133typedef struct mrdb_state {
134 char *command;
135 uint8_t wcnt;
136 uint8_t pi;
137 char *words[MAX_COMMAND_WORD];
138 const char *srcpath;
139 uint32_t print_no;
140
141 mrb_debug_context *dbg;
142} mrdb_state;
143
144typedef dbgcmd_state (*debug_command_func)(mrb_state*, mrdb_state*);
145
146/* cmdrun.c */
147dbgcmd_state dbgcmd_run(mrb_state*, mrdb_state*);
148dbgcmd_state dbgcmd_continue(mrb_state*, mrdb_state*);
149dbgcmd_state dbgcmd_step(mrb_state*, mrdb_state*);
150dbgcmd_state dbgcmd_next(mrb_state*, mrdb_state*);
151/* cmdbreak.c */
152dbgcmd_state dbgcmd_break(mrb_state*, mrdb_state*);
153dbgcmd_state dbgcmd_info_break(mrb_state*, mrdb_state*);
154dbgcmd_state dbgcmd_delete(mrb_state*, mrdb_state*);
155dbgcmd_state dbgcmd_enable(mrb_state*, mrdb_state*);
156dbgcmd_state dbgcmd_disable(mrb_state*, mrdb_state*);
157/* cmdprint.c */
158dbgcmd_state dbgcmd_print(mrb_state*, mrdb_state*);
159dbgcmd_state dbgcmd_eval(mrb_state*, mrdb_state*);
160/* cmdmisc.c */
161dbgcmd_state dbgcmd_list(mrb_state*, mrdb_state*);
162dbgcmd_state dbgcmd_help(mrb_state*, mrdb_state*);
163dbgcmd_state dbgcmd_quit(mrb_state*, mrdb_state*);
164
165#endif
Note: See TracBrowser for help on using the repository browser.