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:
Ryan Fleury
2024-10-18 15:16:34 -07:00
parent 1f633a029c
commit 98dfedfff5
3 changed files with 47 additions and 32 deletions
+31 -28
View File
@@ -14141,39 +14141,42 @@ rd_frame(void)
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_Entity *recent_file = rd_entity_from_handle(rd_regs()->entity);
String8 recent_file_path = recent_file->string;
RD_Panel *existing_panel = &rd_nil_panel;
RD_View *existing_view = &rd_nil_view;
for(RD_Panel *panel = ws->root_panel; !rd_panel_is_nil(panel); panel = rd_panel_rec_depth_first_pre(panel).next)
if(!rd_entity_is_nil(recent_file))
{
if(!rd_panel_is_nil(panel->first))
String8 recent_file_path = recent_file->string;
RD_Panel *existing_panel = &rd_nil_panel;
RD_View *existing_view = &rd_nil_view;
for(RD_Panel *panel = ws->root_panel; !rd_panel_is_nil(panel); panel = rd_panel_rec_depth_first_pre(panel).next)
{
continue;
}
for(RD_View *v = panel->first_tab_view; !rd_view_is_nil(v); v = v->order_next)
{
if(rd_view_is_project_filtered(v)) { continue; }
String8 v_path = rd_file_path_from_eval_string(scratch.arena, str8(v->query_buffer, v->query_string_size));
RD_ViewRuleKind v_kind = rd_view_rule_kind_from_string(v->spec->string);
if(str8_match(v_path, recent_file_path, StringMatchFlag_CaseInsensitive) && v_kind == src_view_kind)
if(!rd_panel_is_nil(panel->first))
{
existing_panel = panel;
existing_view = v;
goto done_existing_view_search__switch;
continue;
}
for(RD_View *v = panel->first_tab_view; !rd_view_is_nil(v); v = v->order_next)
{
if(rd_view_is_project_filtered(v)) { continue; }
String8 v_path = rd_file_path_from_eval_string(scratch.arena, str8(v->query_buffer, v->query_string_size));
RD_ViewRuleKind v_kind = rd_view_rule_kind_from_string(v->spec->string);
if(str8_match(v_path, recent_file_path, StringMatchFlag_CaseInsensitive) && v_kind == src_view_kind)
{
existing_panel = panel;
existing_view = v;
goto done_existing_view_search__switch;
}
}
}
}
done_existing_view_search__switch:;
if(rd_view_is_nil(existing_view))
{
rd_cmd(RD_CmdKind_OpenTab,
.string = rd_eval_string_from_file_path(scratch.arena, recent_file_path),
.params_tree = md_tree_from_string(scratch.arena, rd_view_rule_kind_info_table[RD_ViewRuleKind_PendingFile].string)->first);
}
else
{
rd_cmd(RD_CmdKind_FocusPanel, .panel = rd_handle_from_panel(existing_panel));
existing_panel->selected_tab_view = rd_handle_from_view(existing_view);
done_existing_view_search__switch:;
if(rd_view_is_nil(existing_view))
{
rd_cmd(RD_CmdKind_OpenTab,
.string = rd_eval_string_from_file_path(scratch.arena, recent_file_path),
.params_tree = md_tree_from_string(scratch.arena, rd_view_rule_kind_info_table[RD_ViewRuleKind_PendingFile].string)->first);
}
else
{
rd_cmd(RD_CmdKind_FocusPanel, .panel = rd_handle_from_panel(existing_panel));
existing_panel->selected_tab_view = rd_handle_from_view(existing_view);
}
}
}break;
case RD_CmdKind_SwitchToPartnerFile:
+7 -1
View File
@@ -1027,11 +1027,13 @@ rd_string_from_eval_viz_row_column(Arena *arena, EV_View *ev, EV_Row *row, RD_Wa
{
default:{}break;
case RD_WatchViewColumnKind_Expr:
ProfScope("expr cell string")
{
result = ev_expr_string_from_row(arena, row, string_flags);
}break;
case RD_WatchViewColumnKind_Value:
case RD_WatchViewColumnKind_Member:
ProfScope("value/member cell string")
{
EV_ViewRuleList *view_rules = row->view_rules;
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);
}break;
case RD_WatchViewColumnKind_Type:
ProfScope("type cell string")
{
E_IRTreeAndType irtree = e_irtree_and_type_from_expr(arena, row_col_expr);
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);
}break;
case RD_WatchViewColumnKind_ViewRule:
ProfScope("view rule cell string")
{
result = ev_view_rule_from_key(ev, row->key);
}break;
case RD_WatchViewColumnKind_Module:
ProfScope("module cell string")
{
E_Eval eval = e_eval_from_expr(arena, row_col_expr);
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));
}break;
case RD_WatchViewColumnKind_CallStackFrame:
ProfScope("call stack frame cell string")
{
Temp scratch = scratch_begin(&arena, 1);
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)
{
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;
}
}