adjust memory reading fail conditions in trap net generation; fix early-aborting of retry loop in process memory cache lookup

This commit is contained in:
Ryan Fleury
2025-05-22 12:15:31 -07:00
parent 02611de6af
commit 4aeadc12b7
2 changed files with 8 additions and 5 deletions
+1
View File
@@ -1743,6 +1743,7 @@ ctrl_key_from_process_vaddr_range(CTRL_Handle process, Rng1U64 vaddr_range, B32
{ {
async_push_work(ctrl_mem_stream_work, .working_counter = node_working_count); async_push_work(ctrl_mem_stream_work, .working_counter = node_working_count);
requested = 1; requested = 1;
id_working = 1;
} }
else OS_MutexScopeR(process_stripe->rw_mutex) else OS_MutexScopeR(process_stripe->rw_mutex)
{ {
+7 -5
View File
@@ -399,10 +399,11 @@ d_trap_net_from_thread__step_over_line(Arena *arena, CTRL_Entity *thread)
log_infof("]\n"); log_infof("]\n");
} }
} }
B32 good_machine_code = (good_line_info && machine_code.size == dim_1u64(line_vaddr_rng));
// rjf: machine code => ctrl flow analysis // rjf: machine code => ctrl flow analysis
DASM_CtrlFlowInfo ctrl_flow_info = {0}; DASM_CtrlFlowInfo ctrl_flow_info = {0};
if(good_line_info) if(good_machine_code)
{ {
ctrl_flow_info = dasm_ctrl_flow_info_from_arch_vaddr_code(scratch.arena, ctrl_flow_info = dasm_ctrl_flow_info_from_arch_vaddr_code(scratch.arena,
DASM_InstFlag_Call| DASM_InstFlag_Call|
@@ -423,7 +424,7 @@ d_trap_net_from_thread__step_over_line(Arena *arena, CTRL_Entity *thread)
} }
// rjf: push traps for all exit points // rjf: push traps for all exit points
if(good_line_info) for(DASM_CtrlFlowPointNode *n = ctrl_flow_info.exit_points.first; n != 0; n = n->next) if(good_machine_code) for(DASM_CtrlFlowPointNode *n = ctrl_flow_info.exit_points.first; n != 0; n = n->next)
{ {
DASM_CtrlFlowPoint *point = &n->v; DASM_CtrlFlowPoint *point = &n->v;
CTRL_TrapFlags flags = 0; CTRL_TrapFlags flags = 0;
@@ -539,10 +540,11 @@ d_trap_net_from_thread__step_into_line(Arena *arena, CTRL_Entity *thread)
CTRL_ProcessMemorySlice machine_code_slice = ctrl_process_memory_slice_from_vaddr_range(scratch.arena, process->handle, line_vaddr_rng, os_now_microseconds()+5000); CTRL_ProcessMemorySlice machine_code_slice = ctrl_process_memory_slice_from_vaddr_range(scratch.arena, process->handle, line_vaddr_rng, os_now_microseconds()+5000);
machine_code = machine_code_slice.data; machine_code = machine_code_slice.data;
} }
B32 good_machine_code = (good_line_info && machine_code.size == dim_1u64(line_vaddr_rng));
// rjf: machine code => ctrl flow analysis // rjf: machine code => ctrl flow analysis
DASM_CtrlFlowInfo ctrl_flow_info = {0}; DASM_CtrlFlowInfo ctrl_flow_info = {0};
if(good_line_info) if(good_machine_code)
{ {
ctrl_flow_info = dasm_ctrl_flow_info_from_arch_vaddr_code(scratch.arena, ctrl_flow_info = dasm_ctrl_flow_info_from_arch_vaddr_code(scratch.arena,
DASM_InstFlag_Call| DASM_InstFlag_Call|
@@ -557,7 +559,7 @@ d_trap_net_from_thread__step_into_line(Arena *arena, CTRL_Entity *thread)
// rjf: determine last // rjf: determine last
DASM_CtrlFlowPoint *last_call_point = 0; DASM_CtrlFlowPoint *last_call_point = 0;
if(good_line_info) for(DASM_CtrlFlowPointNode *n = ctrl_flow_info.exit_points.first; n != 0; n = n->next) if(good_machine_code) for(DASM_CtrlFlowPointNode *n = ctrl_flow_info.exit_points.first; n != 0; n = n->next)
{ {
if(n->v.inst_flags & DASM_InstFlag_Call) if(n->v.inst_flags & DASM_InstFlag_Call)
{ {
@@ -566,7 +568,7 @@ d_trap_net_from_thread__step_into_line(Arena *arena, CTRL_Entity *thread)
} }
// rjf: push traps for all exit points // rjf: push traps for all exit points
if(good_line_info) for(DASM_CtrlFlowPointNode *n = ctrl_flow_info.exit_points.first; n != 0; n = n->next) if(good_machine_code) for(DASM_CtrlFlowPointNode *n = ctrl_flow_info.exit_points.first; n != 0; n = n->next)
{ {
DASM_CtrlFlowPoint *point = &n->v; DASM_CtrlFlowPoint *point = &n->v;
CTRL_TrapFlags flags = 0; CTRL_TrapFlags flags = 0;