Fix source debugger error handling: continue executing when detached (#1725)

Change main thread hangs when encounter debugger encounters error to
main thread exits when debugger encounters error
Change main thread blocks when debugger detaches to
main thread continues executing when debugger detaches, and main thread
exits normally when finishing executing
This commit is contained in:
TianlongLiang
2022-11-28 22:12:46 +08:00
committed by GitHub
parent 12bcc20710
commit be7a4abee2
3 changed files with 96 additions and 13 deletions

View File

@ -42,7 +42,8 @@ typedef enum debug_state_t {
*/
DBG_LAUNCHING,
APP_RUNNING,
APP_STOPPED
APP_STOPPED,
DBG_ERROR
} debug_state_t;
typedef struct WASMDebugExecutionMemory {
@ -108,6 +109,9 @@ typedef enum WasmAddressType {
void
on_thread_stop_event(WASMDebugInstance *debug_inst, WASMExecEnv *exec_env);
void
on_thread_exit_event(WASMDebugInstance *debug_inst, WASMExecEnv *exec_env);
WASMDebugInstance *
wasm_debug_instance_create(WASMCluster *cluster, int32 port);
@ -180,6 +184,9 @@ bool
wasm_debug_instance_remove_breakpoint(WASMDebugInstance *instance, uint64 addr,
uint64 length);
bool
wasm_debug_instance_on_failure(WASMDebugInstance *instance);
bool
wasm_debug_instance_interrupt_all_threads(WASMDebugInstance *instance);