adjust single stepping rule to be robust to non-single-step events; this is still not what the issue is pertaining to the stepping bug...

This commit is contained in:
Ryan Fleury
2024-06-18 17:19:17 -07:00
parent 41fd224956
commit f6eec680bc
3 changed files with 86 additions and 24 deletions
+4 -5
View File
@@ -1449,7 +1449,7 @@ dmn_ctrl_run(Arena *arena, DMN_CtrlCtx *ctx, DMN_RunCtrls *ctrls)
if(single_step_thread_ctx != 0)
{
U64 rflags = single_step_thread_ctx->EFlags|0x2;
U64 new_rflags = rflags |= 0x100;
U64 new_rflags = rflags | 0x100;
single_step_thread_ctx->EFlags = new_rflags;
SetThreadContext(thread->handle, single_step_thread_ctx);
ins_atomic_u64_inc_eval(&dmn_w32_shared->reg_gen);
@@ -1517,10 +1517,9 @@ dmn_ctrl_run(Arena *arena, DMN_CtrlCtx *ctx, DMN_RunCtrls *ctrls)
B32 is_frozen = 0;
{
// rjf: single-step? freeze if not the single-step thread.
if(!dmn_handle_match(dmn_handle_zero(), ctrls->single_step_thread) &&
!dmn_handle_match(dmn_w32_handle_from_entity(thread), ctrls->single_step_thread))
if(!dmn_handle_match(dmn_handle_zero(), ctrls->single_step_thread))
{
is_frozen = 1;
is_frozen = !dmn_handle_match(dmn_w32_handle_from_entity(thread), ctrls->single_step_thread);
}
// rjf: not single-stepping? determine based on run controls freezing info
@@ -2430,7 +2429,7 @@ dmn_ctrl_run(Arena *arena, DMN_CtrlCtx *ctx, DMN_RunCtrls *ctrls)
if(ctx != 0)
{
U64 rflags = single_step_thread_ctx->EFlags|0x2;
U64 new_rflags = rflags &= ~0x100;
U64 new_rflags = rflags & ~0x100;
single_step_thread_ctx->EFlags = new_rflags;
SetThreadContext(thread->handle, single_step_thread_ctx);
ins_atomic_u64_inc_eval(&dmn_w32_shared->reg_gen);
+2
View File
@@ -54,6 +54,8 @@
#define DMN_W32_EXCEPTION_NO_MEMORY 0xC0000017u
#define DMN_W32_EXCEPTION_THROW 0xE06D7363u
#define DMN_W32_EXCEPTION_SET_THREAD_NAME 0x406d1388u
#define DMN_w32_EXCEPTION_CLRDBG_NOTIFICATION 0x04242420u
#define DMN_w32_EXCEPTION_CLR 0xE0434352u
////////////////////////////////
//~ rjf: Win32 Register Codes