From e278861206a6472ed2cf1f4b306ba7bc60a0b087 Mon Sep 17 00:00:00 2001 From: Xu Jun <693788454@qq.com> Date: Mon, 7 Nov 2022 11:57:53 +0800 Subject: [PATCH] Avoid raising exception when debugging with VSCode (#1686) --- core/iwasm/libraries/debug-engine/debug_engine.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/iwasm/libraries/debug-engine/debug_engine.c b/core/iwasm/libraries/debug-engine/debug_engine.c index 4fd89930..1698153d 100644 --- a/core/iwasm/libraries/debug-engine/debug_engine.c +++ b/core/iwasm/libraries/debug-engine/debug_engine.c @@ -245,7 +245,10 @@ wasm_debug_control_thread_create(WASMDebugInstance *debug_instance, int32 port) bh_list_insert(&g_debug_engine->debug_instance_list, debug_instance); os_mutex_unlock(&g_debug_engine->instance_list_lock); - wasm_cluster_send_signal_all(debug_instance->cluster, WAMR_SIG_STOP); + /* If we set WAMR_SIG_STOP here, the VSCode debugger adaptor will raise an + * exception in the UI. We use WAMR_SIG_SINGSTEP to avoid this exception for + * better user experience */ + wasm_cluster_send_signal_all(debug_instance->cluster, WAMR_SIG_SINGSTEP); return control_thread;