diff --git a/src/ctrl/ctrl_core.c b/src/ctrl/ctrl_core.c index f4eb8d3b..9b612b75 100644 --- a/src/ctrl/ctrl_core.c +++ b/src/ctrl/ctrl_core.c @@ -1775,7 +1775,7 @@ ctrl_key_from_process_vaddr_range(CTRL_Handle process, Rng1U64 vaddr_range, B32 { break; } - else if(!id_working && requested) + else if(!id_working) { break; } diff --git a/src/mule/mule_main.cpp b/src/mule/mule_main.cpp index 49493d21..c81f4f6e 100644 --- a/src/mule/mule_main.cpp +++ b/src/mule/mule_main.cpp @@ -2658,6 +2658,56 @@ recursion_stepping_tests(void){ } +//////////////////////////////// +// NOTE(rjf): Thread Stepping + +#if _WIN32 +DWORD thread_step_thread(void *p) +{ + int x = 0; + for(int i = 0; i < 100000; i += 1) + { + x += 1; + x += 1; + x += 1; + x += 1; + x += 1; + x += 1; + x += 1; + x += 1; + x += 1; + x += 1; + x += 1; + x += 1; + x += 1; + x += 1; + } + return 0; +} +#endif + +void thread_stepping_tests(void) +{ +#if _WIN32 + HANDLE h[64] = {0}; + for(int i = 0; i < sizeof(h)/sizeof(h[0]); i += 1) + { + DWORD id = 0; + h[i] = CreateThread(0, 0, thread_step_thread, 0, CREATE_SUSPENDED, &id); + raddbg_thread_id_name(id, "thread_step_thread_%i", i); + raddbg_thread_id_color_u32(id, 0xff9f23ff); + } + for(int i = 0; i < sizeof(h)/sizeof(h[0]); i += 1) + { + ResumeThread(h[i]); + } + for(int i = 0; i < sizeof(h)/sizeof(h[0]); i += 1) + { + WaitForSingleObject(h[i], INFINITE); + } +#endif +} + //////////////////////////////// // NOTE(rjf): Debug Strings @@ -3073,6 +3123,8 @@ mule_main(int argc, char** argv) recursion_stepping_tests(); + thread_stepping_tests(); + debug_string_tests(); thread_name_tests(); diff --git a/src/raddbg/raddbg_widgets.c b/src/raddbg/raddbg_widgets.c index 69bc2f63..45c2bfd6 100644 --- a/src/raddbg/raddbg_widgets.c +++ b/src/raddbg/raddbg_widgets.c @@ -548,7 +548,7 @@ rd_title_fstrs_from_ctrl_entity(Arena *arena, CTRL_Entity *entity, B32 include_e Arch arch = entity->arch; B32 call_stack_high_priority = ctrl_handle_match(entity->handle, rd_base_regs()->thread); CTRL_CallStack call_stack = ctrl_call_stack_from_thread(ctrl_scope, &d_state->ctrl_entity_store->ctx, entity, call_stack_high_priority, call_stack_high_priority ? rd_state->frame_eval_memread_endt_us : 0); - for(U64 idx = 0, limit = 6; idx < call_stack.frames_count && idx < limit; idx += 1) + for(U64 idx = 0, limit = 10; idx < call_stack.frames_count && idx < limit; idx += 1) { CTRL_CallStackFrame *f = &call_stack.frames[call_stack.frames_count - 1 - idx]; U64 rip_vaddr = regs_rip_from_arch_block(arch, f->regs);