rd: prioritize fastpath for non-unwound register reads; d2r2: prepass to find all top-level tag trees, subdivide unit work on a root-level tag tree basis

This commit is contained in:
Ryan Fleury
2026-05-01 12:34:35 -07:00
parent 0b26b1c83e
commit 0b5e827f6c
4 changed files with 1271 additions and 1002 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ commands =
// .f1 = { .win = "raddbg_stable --ipc kill_all && build raddbg meta telemetry", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, }, // .f1 = { .win = "raddbg_stable --ipc kill_all && build raddbg meta telemetry", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
// .f1 = { .win = "raddbg_stable --ipc kill_all && build raddbg debug telemetry", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, }, // .f1 = { .win = "raddbg_stable --ipc kill_all && build raddbg debug telemetry", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
// .f1 = { .win = "raddbg_stable --ipc kill_all && build radbin", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, }, // .f1 = { .win = "raddbg_stable --ipc kill_all && build radbin", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
.f1 = { .win = "build radbin telemetry release", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, }, .f1 = { .win = "build radbin release telemetry", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
//- rjf: [raddbg wsl] //- rjf: [raddbg wsl]
// .f1 = { .win = "wsl ./build.sh raddbg", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, }, // .f1 = { .win = "wsl ./build.sh raddbg", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
+17 -5
View File
@@ -769,16 +769,28 @@ rd_eval_space_read(E_Space space, void *out, Rng1U64 range)
case D_EntityKind_Thread: case D_EntityKind_Thread:
{ {
Access *access = access_open(); Access *access = access_open();
D_CallStack call_stack = d_call_stack_from_thread(access, entity->handle, 1, rd_state->frame_eval_memread_endt_us); void *regs_block = 0;
U64 concrete_frame_idx = e_interpret_ctx->reg_unwind_count; if(e_interpret_ctx->reg_unwind_count == 0)
if(concrete_frame_idx < call_stack.concrete_frames_count) {
regs_block = d_reg_block_from_thread(scratch.arena, &d_user_state->ctrl_entity_store->ctx, entity->handle);
}
else
{
D_CallStack call_stack = d_call_stack_from_thread(access, entity->handle, 1, rd_state->frame_eval_memread_endt_us);
U64 concrete_frame_idx = e_interpret_ctx->reg_unwind_count;
if(concrete_frame_idx < call_stack.concrete_frames_count)
{
D_CallStackFrame *f = call_stack.concrete_frames[concrete_frame_idx];
regs_block = f->regs;
}
}
if(regs_block != 0)
{ {
D_CallStackFrame *f = call_stack.concrete_frames[concrete_frame_idx];
U64 regs_size = regs_block_size_from_arch(e_interpret_ctx->reg_arch); U64 regs_size = regs_block_size_from_arch(e_interpret_ctx->reg_arch);
Rng1U64 legal_range = r1u64(0, regs_size); Rng1U64 legal_range = r1u64(0, regs_size);
Rng1U64 read_range = intersect_1u64(legal_range, range); Rng1U64 read_range = intersect_1u64(legal_range, range);
U64 read_size = dim_1u64(read_range); U64 read_size = dim_1u64(read_range);
MemoryCopy(out, (U8 *)f->regs + read_range.min, read_size); MemoryCopy(out, (U8 *)regs_block + read_range.min, read_size);
result = (read_size == dim_1u64(range)); result = (read_size == dim_1u64(range));
} }
access_close(access); access_close(access);
+2 -2
View File
@@ -537,7 +537,7 @@ lane_sync(); if(flags & (1ull<<(kind))) ProfScope(rdi_name_title_from_dump_subse
{ {
if(lane_idx() == 0) if(lane_idx() == 0)
{ {
dumpf("\n // %-16s %-16s %-12s %-12s %-12s %s\n", "name", "flags", "voff_first", "voff_opl", "foff_first", "foff_opl"); dumpf("\n // %-32s %-16s %-12s %-12s %-12s %s\n", "name", "flags", "voff_first", "voff_opl", "foff_first", "foff_opl");
} }
U64 count = 0; U64 count = 0;
RDI_BinarySection *v = rdi_table_from_name(rdi, BinarySections, &count); RDI_BinarySection *v = rdi_table_from_name(rdi, BinarySections, &count);
@@ -548,7 +548,7 @@ lane_sync(); if(flags & (1ull<<(kind))) ProfScope(rdi_name_title_from_dump_subse
RDI_BinarySection *bin_section = &v[idx]; RDI_BinarySection *bin_section = &v[idx];
String8 name = str8_from_rdi_string_idx(rdi, bin_section->name_string_idx); String8 name = str8_from_rdi_string_idx(rdi, bin_section->name_string_idx);
String8 flags = rdi_string_from_binary_section_flags(scratch.arena, bin_section->flags); String8 flags = rdi_string_from_binary_section_flags(scratch.arena, bin_section->flags);
dumpf(" { %-16S %-16S 0x%-10I64x 0x%-10I64x 0x%-10I64x 0x%-10I64x } // binary_section[%I64u]\n", dumpf(" { %-32S %-16S 0x%-10I64x 0x%-10I64x 0x%-10I64x 0x%-10I64x } // binary_section[%I64u]\n",
push_str8f(scratch.arena, "'%S'", name), push_str8f(scratch.arena, "'%S'", name),
push_str8f(scratch.arena, "`%S`", flags), push_str8f(scratch.arena, "`%S`", flags),
bin_section->voff_first, bin_section->voff_first,
File diff suppressed because it is too large Load Diff