mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-07 06:18:42 +00:00
limit the amount of line info visualization voff gathering; otherwise we can just spend tons of time gathering inline site voffs forever...
This commit is contained in:
@@ -951,6 +951,7 @@ d_lines_array_from_file_path_line_range(Arena *arena, String8 file_path, Rng1S64
|
|||||||
array.v = push_array(arena, D_LineList, array.count);
|
array.v = push_array(arena, D_LineList, array.count);
|
||||||
}
|
}
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
|
U64 *lines_num_voffs = push_array(scratch.arena, U64, array.count);
|
||||||
DI_Scope *scope = di_scope_open();
|
DI_Scope *scope = di_scope_open();
|
||||||
DI_KeyList dbgi_keys = d_push_active_dbgi_key_list(scratch.arena);
|
DI_KeyList dbgi_keys = d_push_active_dbgi_key_list(scratch.arena);
|
||||||
String8List overrides = rd_possible_overrides_from_file_path(scratch.arena, file_path);
|
String8List overrides = rd_possible_overrides_from_file_path(scratch.arena, file_path);
|
||||||
@@ -971,7 +972,7 @@ d_lines_array_from_file_path_line_range(Arena *arena, String8 file_path, Rng1S64
|
|||||||
// rjf: file_path_normalized * rdi -> src_id
|
// rjf: file_path_normalized * rdi -> src_id
|
||||||
B32 good_src_id = 0;
|
B32 good_src_id = 0;
|
||||||
U32 src_id = 0;
|
U32 src_id = 0;
|
||||||
if(rdi != &di_rdi_parsed_nil)
|
if(rdi != &di_rdi_parsed_nil) ProfScope("file_path_normalized * rdi -> src_id")
|
||||||
{
|
{
|
||||||
RDI_NameMap *mapptr = rdi_element_from_name_idx(rdi, NameMaps, RDI_NameMapKind_NormalSourcePaths);
|
RDI_NameMap *mapptr = rdi_element_from_name_idx(rdi, NameMaps, RDI_NameMapKind_NormalSourcePaths);
|
||||||
RDI_ParsedNameMap map = {0};
|
RDI_ParsedNameMap map = {0};
|
||||||
@@ -990,7 +991,7 @@ d_lines_array_from_file_path_line_range(Arena *arena, String8 file_path, Rng1S64
|
|||||||
}
|
}
|
||||||
|
|
||||||
// rjf: good src-id -> look up line info for visible range
|
// rjf: good src-id -> look up line info for visible range
|
||||||
if(good_src_id)
|
if(good_src_id) ProfScope("good src-id -> look up line info for visible range")
|
||||||
{
|
{
|
||||||
RDI_SourceFile *src = rdi_element_from_name_idx(rdi, SourceFiles, src_id);
|
RDI_SourceFile *src = rdi_element_from_name_idx(rdi, SourceFiles, src_id);
|
||||||
RDI_SourceLineMap *src_line_map = rdi_element_from_name_idx(rdi, SourceLineMaps, src->source_line_map_idx);
|
RDI_SourceLineMap *src_line_map = rdi_element_from_name_idx(rdi, SourceLineMaps, src->source_line_map_idx);
|
||||||
@@ -1004,7 +1005,7 @@ d_lines_array_from_file_path_line_range(Arena *arena, String8 file_path, Rng1S64
|
|||||||
D_LineList *list = &array.v[line_idx];
|
D_LineList *list = &array.v[line_idx];
|
||||||
U32 voff_count = 0;
|
U32 voff_count = 0;
|
||||||
U64 *voffs = rdi_line_voffs_from_num(&line_map, u32_from_u64_saturate((U64)line_num), &voff_count);
|
U64 *voffs = rdi_line_voffs_from_num(&line_map, u32_from_u64_saturate((U64)line_num), &voff_count);
|
||||||
for(U64 idx = 0; idx < voff_count; idx += 1)
|
if(lines_num_voffs[line_idx] < 8) ProfScope("iterate voffs (%i)", voff_count) for(U64 idx = 0; idx < voff_count; idx += 1)
|
||||||
{
|
{
|
||||||
U64 base_voff = voffs[idx];
|
U64 base_voff = voffs[idx];
|
||||||
U64 unit_idx = rdi_vmap_idx_from_section_kind_voff(rdi, RDI_SectionKind_UnitVMap, base_voff);
|
U64 unit_idx = rdi_vmap_idx_from_section_kind_voff(rdi, RDI_SectionKind_UnitVMap, base_voff);
|
||||||
@@ -1024,6 +1025,11 @@ d_lines_array_from_file_path_line_range(Arena *arena, String8 file_path, Rng1S64
|
|||||||
n->v.dbgi_key = key;
|
n->v.dbgi_key = key;
|
||||||
SLLQueuePush(list->first, list->last, n);
|
SLLQueuePush(list->first, list->last, n);
|
||||||
list->count += 1;
|
list->count += 1;
|
||||||
|
lines_num_voffs[line_idx] += 1;
|
||||||
|
if(lines_num_voffs[line_idx] >= 8)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14141,6 +14141,8 @@ rd_frame(void)
|
|||||||
RD_View *src_view = rd_view_from_handle(rd_regs()->view);
|
RD_View *src_view = rd_view_from_handle(rd_regs()->view);
|
||||||
RD_ViewRuleKind src_view_kind = rd_view_rule_kind_from_string(src_view->spec->string);
|
RD_ViewRuleKind src_view_kind = rd_view_rule_kind_from_string(src_view->spec->string);
|
||||||
RD_Entity *recent_file = rd_entity_from_handle(rd_regs()->entity);
|
RD_Entity *recent_file = rd_entity_from_handle(rd_regs()->entity);
|
||||||
|
if(!rd_entity_is_nil(recent_file))
|
||||||
|
{
|
||||||
String8 recent_file_path = recent_file->string;
|
String8 recent_file_path = recent_file->string;
|
||||||
RD_Panel *existing_panel = &rd_nil_panel;
|
RD_Panel *existing_panel = &rd_nil_panel;
|
||||||
RD_View *existing_view = &rd_nil_view;
|
RD_View *existing_view = &rd_nil_view;
|
||||||
@@ -14175,6 +14177,7 @@ rd_frame(void)
|
|||||||
rd_cmd(RD_CmdKind_FocusPanel, .panel = rd_handle_from_panel(existing_panel));
|
rd_cmd(RD_CmdKind_FocusPanel, .panel = rd_handle_from_panel(existing_panel));
|
||||||
existing_panel->selected_tab_view = rd_handle_from_view(existing_view);
|
existing_panel->selected_tab_view = rd_handle_from_view(existing_view);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}break;
|
}break;
|
||||||
case RD_CmdKind_SwitchToPartnerFile:
|
case RD_CmdKind_SwitchToPartnerFile:
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1027,11 +1027,13 @@ rd_string_from_eval_viz_row_column(Arena *arena, EV_View *ev, EV_Row *row, RD_Wa
|
|||||||
{
|
{
|
||||||
default:{}break;
|
default:{}break;
|
||||||
case RD_WatchViewColumnKind_Expr:
|
case RD_WatchViewColumnKind_Expr:
|
||||||
|
ProfScope("expr cell string")
|
||||||
{
|
{
|
||||||
result = ev_expr_string_from_row(arena, row, string_flags);
|
result = ev_expr_string_from_row(arena, row, string_flags);
|
||||||
}break;
|
}break;
|
||||||
case RD_WatchViewColumnKind_Value:
|
case RD_WatchViewColumnKind_Value:
|
||||||
case RD_WatchViewColumnKind_Member:
|
case RD_WatchViewColumnKind_Member:
|
||||||
|
ProfScope("value/member cell string")
|
||||||
{
|
{
|
||||||
EV_ViewRuleList *view_rules = row->view_rules;
|
EV_ViewRuleList *view_rules = row->view_rules;
|
||||||
if(col->view_rule_size != 0)
|
if(col->view_rule_size != 0)
|
||||||
@@ -1043,6 +1045,7 @@ rd_string_from_eval_viz_row_column(Arena *arena, EV_View *ev, EV_Row *row, RD_Wa
|
|||||||
result = rd_value_string_from_eval(arena, string_flags, default_radix, font, font_size, max_size_px, eval, row->member, view_rules);
|
result = rd_value_string_from_eval(arena, string_flags, default_radix, font, font_size, max_size_px, eval, row->member, view_rules);
|
||||||
}break;
|
}break;
|
||||||
case RD_WatchViewColumnKind_Type:
|
case RD_WatchViewColumnKind_Type:
|
||||||
|
ProfScope("type cell string")
|
||||||
{
|
{
|
||||||
E_IRTreeAndType irtree = e_irtree_and_type_from_expr(arena, row_col_expr);
|
E_IRTreeAndType irtree = e_irtree_and_type_from_expr(arena, row_col_expr);
|
||||||
E_TypeKey type_key = irtree.type_key;
|
E_TypeKey type_key = irtree.type_key;
|
||||||
@@ -1050,10 +1053,12 @@ rd_string_from_eval_viz_row_column(Arena *arena, EV_View *ev, EV_Row *row, RD_Wa
|
|||||||
result = str8_skip_chop_whitespace(result);
|
result = str8_skip_chop_whitespace(result);
|
||||||
}break;
|
}break;
|
||||||
case RD_WatchViewColumnKind_ViewRule:
|
case RD_WatchViewColumnKind_ViewRule:
|
||||||
|
ProfScope("view rule cell string")
|
||||||
{
|
{
|
||||||
result = ev_view_rule_from_key(ev, row->key);
|
result = ev_view_rule_from_key(ev, row->key);
|
||||||
}break;
|
}break;
|
||||||
case RD_WatchViewColumnKind_Module:
|
case RD_WatchViewColumnKind_Module:
|
||||||
|
ProfScope("module cell string")
|
||||||
{
|
{
|
||||||
E_Eval eval = e_eval_from_expr(arena, row_col_expr);
|
E_Eval eval = e_eval_from_expr(arena, row_col_expr);
|
||||||
E_Eval value_eval = e_value_eval_from_eval(eval);
|
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||||
@@ -1063,6 +1068,7 @@ rd_string_from_eval_viz_row_column(Arena *arena, EV_View *ev, EV_Row *row, RD_Wa
|
|||||||
result = push_str8_copy(arena, str8_skip_last_slash(module->string));
|
result = push_str8_copy(arena, str8_skip_last_slash(module->string));
|
||||||
}break;
|
}break;
|
||||||
case RD_WatchViewColumnKind_CallStackFrame:
|
case RD_WatchViewColumnKind_CallStackFrame:
|
||||||
|
ProfScope("call stack frame cell string")
|
||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
DI_Scope *di_scope = di_scope_open();
|
DI_Scope *di_scope = di_scope_open();
|
||||||
@@ -2232,7 +2238,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
|
|||||||
if(row_eval.mode == E_Mode_Value)
|
if(row_eval.mode == E_Mode_Value)
|
||||||
{
|
{
|
||||||
CTRL_Entity *process = ctrl_process_from_entity(row_ctrl_entity);
|
CTRL_Entity *process = ctrl_process_from_entity(row_ctrl_entity);
|
||||||
row_module = ctrl_module_from_process_vaddr(process, row_eval.value.u64);
|
row_module = ctrl_module_from_process_vaddr(process, d_query_cached_rip_from_thread(row_ctrl_entity));
|
||||||
}break;
|
}break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user