fix debugger: Set termination flags also when in debug mode (#2048)

When using multiple threads, termination flags are checked to stop the thread
if a `proc_exit` or trap occurs. They have to be set also in debug mode.

Tested using [WASI thread tests](https://github.com/bytecodealliance/wasm-micro-runtime/tree/main/core/iwasm/libraries/lib-wasi-threads/test).
This commit is contained in:
Enrico Loparco 2023-03-23 07:10:47 +01:00 committed by GitHub
parent d06d2d3754
commit bfbe51e1b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -988,12 +988,12 @@ static void
set_thread_cancel_flags(WASMExecEnv *exec_env)
{
os_mutex_lock(&exec_env->wait_lock);
/* Set the termination flag */
#if WASM_ENABLE_DEBUG_INTERP != 0
wasm_cluster_thread_send_signal(exec_env, WAMR_SIG_TERM);
#else
exec_env->suspend_flags.flags |= 0x01;
#endif
exec_env->suspend_flags.flags |= 0x01;
os_mutex_unlock(&exec_env->wait_lock);
}