many-thread-stepping test in mule, adjust call stack thread name decoration limit, now that call stack computation is async; tweak ctrl process memory cache lookup exit condition to be more robust to failed-read cases

This commit is contained in:
Ryan Fleury
2025-06-02 11:59:49 -07:00
parent e83c74db29
commit becb61f00d
3 changed files with 54 additions and 2 deletions
+1 -1
View File
@@ -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;
}
+52
View File
@@ -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();
+1 -1
View File
@@ -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);