|
15 | 15 | #ifdef __cplusplus |
16 | 16 | extern "C" { |
17 | 17 | #endif |
18 | | -#if WASM_ENABLE_DEBUG_INTERP != 0 |
19 | | -#define WAMR_SIG_TRAP (5) |
20 | | -#define WAMR_SIG_STOP (19) |
21 | | -#define WAMR_SIG_TERM (15) |
22 | | -#define WAMR_SIG_SINGSTEP (0x1ff) |
23 | | - |
24 | | -#define STATUS_RUNNING (0) |
25 | | -#define STATUS_STOP (1) |
26 | | -#define STATUS_EXIT (2) |
27 | | -#define STATUS_STEP (3) |
28 | | - |
29 | | -#define IS_WAMR_TERM_SIG(signo) ((signo) == WAMR_SIG_TERM) |
30 | | - |
31 | | -#define IS_WAMR_STOP_SIG(signo) \ |
32 | | - ((signo) == WAMR_SIG_STOP || (signo) == WAMR_SIG_TRAP) |
33 | | - |
34 | | -typedef struct WASMCurrentEnvStatus { |
35 | | - uint64 signal_flag : 32; |
36 | | - uint64 step_count : 16; |
37 | | - uint64 running_status : 16; |
38 | | - korp_mutex wait_lock; |
39 | | - korp_cond wait_cond; |
40 | | -} WASMCurrentEnvStatus; |
41 | 18 |
|
| 19 | +#if WASM_ENABLE_DEBUG_INTERP != 0 |
42 | 20 | typedef struct WASMDebugInstance WASMDebugInstance; |
43 | | - |
44 | | -WASMCurrentEnvStatus * |
45 | | -wasm_cluster_create_exenv_status(); |
46 | | - |
47 | | -void |
48 | | -wasm_cluster_destroy_exenv_status(WASMCurrentEnvStatus *status); |
49 | | - |
50 | | -void |
51 | | -wasm_cluster_send_signal_all(WASMCluster *cluster, uint32 signo); |
52 | | - |
53 | | -void |
54 | | -wasm_cluster_thread_stopped(WASMExecEnv *exec_env); |
55 | | - |
56 | | -void |
57 | | -wasm_cluster_thread_waiting_run(WASMExecEnv *exec_env); |
58 | | - |
59 | | -void |
60 | | -wasm_cluster_wait_thread_status(WASMExecEnv *exec_env, uint32 *status); |
61 | | - |
62 | | -void |
63 | | -wasm_cluster_thread_exited(WASMExecEnv *exec_env); |
64 | | - |
65 | | -void |
66 | | -wasm_cluster_thread_continue(WASMExecEnv *exec_env); |
67 | | - |
68 | | -void |
69 | | -wasm_cluster_thread_send_signal(WASMExecEnv *exec_env, uint32 signo); |
70 | | - |
71 | | -void |
72 | | -wasm_cluster_thread_step(WASMExecEnv *exec_env); |
73 | | - |
74 | | -void |
75 | | -wasm_cluster_set_debug_inst(WASMCluster *cluster, WASMDebugInstance *inst); |
76 | | - |
77 | 21 | #endif |
78 | 22 | typedef struct WASMCluster { |
79 | 23 | struct WASMCluster *next; |
@@ -183,6 +127,65 @@ void |
183 | 127 | wasm_cluster_spread_custom_data(WASMModuleInstanceCommon *module_inst, |
184 | 128 | void *custom_data); |
185 | 129 |
|
| 130 | +#if WASM_ENABLE_DEBUG_INTERP != 0 |
| 131 | +#define WAMR_SIG_TRAP (5) |
| 132 | +#define WAMR_SIG_STOP (19) |
| 133 | +#define WAMR_SIG_TERM (15) |
| 134 | +#define WAMR_SIG_SINGSTEP (0x1ff) |
| 135 | + |
| 136 | +#define STATUS_RUNNING (0) |
| 137 | +#define STATUS_STOP (1) |
| 138 | +#define STATUS_EXIT (2) |
| 139 | +#define STATUS_STEP (3) |
| 140 | + |
| 141 | +#define IS_WAMR_TERM_SIG(signo) ((signo) == WAMR_SIG_TERM) |
| 142 | + |
| 143 | +#define IS_WAMR_STOP_SIG(signo) \ |
| 144 | + ((signo) == WAMR_SIG_STOP || (signo) == WAMR_SIG_TRAP) |
| 145 | + |
| 146 | +typedef struct WASMCurrentEnvStatus { |
| 147 | + uint64 signal_flag : 32; |
| 148 | + uint64 step_count : 16; |
| 149 | + uint64 running_status : 16; |
| 150 | + korp_mutex wait_lock; |
| 151 | + korp_cond wait_cond; |
| 152 | +} WASMCurrentEnvStatus; |
| 153 | + |
| 154 | +WASMCurrentEnvStatus * |
| 155 | +wasm_cluster_create_exenv_status(); |
| 156 | + |
| 157 | +void |
| 158 | +wasm_cluster_destroy_exenv_status(WASMCurrentEnvStatus *status); |
| 159 | + |
| 160 | +void |
| 161 | +wasm_cluster_send_signal_all(WASMCluster *cluster, uint32 signo); |
| 162 | + |
| 163 | +void |
| 164 | +wasm_cluster_thread_stopped(WASMExecEnv *exec_env); |
| 165 | + |
| 166 | +void |
| 167 | +wasm_cluster_thread_waiting_run(WASMExecEnv *exec_env); |
| 168 | + |
| 169 | +void |
| 170 | +wasm_cluster_wait_thread_status(WASMExecEnv *exec_env, uint32 *status); |
| 171 | + |
| 172 | +void |
| 173 | +wasm_cluster_thread_exited(WASMExecEnv *exec_env); |
| 174 | + |
| 175 | +void |
| 176 | +wasm_cluster_thread_continue(WASMExecEnv *exec_env); |
| 177 | + |
| 178 | +void |
| 179 | +wasm_cluster_thread_send_signal(WASMExecEnv *exec_env, uint32 signo); |
| 180 | + |
| 181 | +void |
| 182 | +wasm_cluster_thread_step(WASMExecEnv *exec_env); |
| 183 | + |
| 184 | +void |
| 185 | +wasm_cluster_set_debug_inst(WASMCluster *cluster, WASMDebugInstance *inst); |
| 186 | + |
| 187 | +#endif /* end of WASM_ENABLE_DEBUG_INTERP != 0 */ |
| 188 | + |
186 | 189 | #ifdef __cplusplus |
187 | 190 | } |
188 | 191 | #endif |
|
0 commit comments