From 4648b27a06882206e3d563b1f6ada2fa16eddd06 Mon Sep 17 00:00:00 2001 From: Nikita Smith Date: Wed, 6 May 2026 15:54:04 -0700 Subject: [PATCH] increase wait time for memory slice in line stepping --- src/dbg_engine/dbg_engine_user.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dbg_engine/dbg_engine_user.c b/src/dbg_engine/dbg_engine_user.c index 13ac7665..715583fc 100644 --- a/src/dbg_engine/dbg_engine_user.c +++ b/src/dbg_engine/dbg_engine_user.c @@ -396,7 +396,10 @@ d_trap_net_from_thread__step_over_line(Arena *arena, D_Entity *thread) B32 good_machine_code = 0; if(good_line_info) { - D_ProcessMemorySlice machine_code_slice = d_process_memory_slice_from_vaddr_range(scratch.arena, process->handle, line_vaddr_rng, 0, now_time_us()+50000); + // TODO: Under WSL, memory fetch takes longer to complete. Previously, 50ms was not enough and d_process_memory_slice_from_vaddr_range + // would return stale memory, causing stepping alg to stop mid-source-line. If I understand correctly, 'wait_for_fresh' should + // guarantee successful stepping here, but even after enabling it, stale memory is returned. + D_ProcessMemorySlice machine_code_slice = d_process_memory_slice_from_vaddr_range(scratch.arena, process->handle, line_vaddr_rng, 0, now_time_us()+10000000); machine_code = machine_code_slice.data; good_machine_code = (machine_code.size >= dim_1u64(line_vaddr_rng) && !machine_code_slice.any_byte_bad); LogInfoNamedBlockF("machine_code_slice")