提交 16067e0a 编写于 作者: T thaystg

[debugger] Native thread not executing managed code considered as terminated

If a thread was suspended and doesn't have any managed stack, it was considered as terminated, but it wasn't really terminated because it can execute managed code again, and stop in a breakpoint so if the execution arrives in debugger_agent_breakpoint_from_context we reset the flag terminated to FALSE.

Fixes #18106
上级 ff3971a1
......@@ -4898,6 +4898,8 @@ debugger_agent_single_step_from_context (MonoContext *ctx)
g_assert (tls);
tls->terminated = FALSE;
/* Have to save/restore the restore_ctx as we can be called recursively during invokes etc. */
memcpy (&orig_restore_state, &tls->restore_state, sizeof (MonoThreadUnwindState));
mono_thread_state_init_from_monoctx (&tls->restore_state, ctx);
......@@ -4924,6 +4926,11 @@ debugger_agent_breakpoint_from_context (MonoContext *ctx)
tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id);
g_assert (tls);
//if a thread was suspended and doesn't have any managed stack, it was considered as terminated,
//but it wasn't really terminated because it can execute managed code again, and stop in a breakpoint so here we set terminated as FALSE
tls->terminated = FALSE;
memcpy (&orig_restore_state, &tls->restore_state, sizeof (MonoThreadUnwindState));
mono_thread_state_init_from_monoctx (&tls->restore_state, ctx);
memcpy (&tls->handler_ctx, ctx, sizeof (MonoContext));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册