mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-13 07:32:23 -07:00
straighten out table coordinates <-> viz block coordinate space mappings, since search-backed tables no longer can assume those two things are the same; clang -> o2; fix clang build
This commit is contained in:
@@ -46,7 +46,7 @@ set clang_common= -I..\src\ -I..\local\ -gcodeview -fdiagnostics-absolute-paths
|
||||
set cl_debug= call cl /Od %cl_common% %auto_compile_flags%
|
||||
set cl_release= call cl /O2 /DNDEBUG %cl_common% %auto_compile_flags%
|
||||
set clang_debug= call clang -g -O0 %clang_common% %auto_compile_flags%
|
||||
set clang_release= call clang -g -O3 -DNDEBUG %clang_common% %auto_compile_flags%
|
||||
set clang_release= call clang -g -O2 -DNDEBUG %clang_common% %auto_compile_flags%
|
||||
set cl_link= /link /MANIFEST:EMBED /INCREMENTAL:NO /natvis:"%~dp0\src\natvis\base.natvis" logo.res
|
||||
set clang_link= -fuse-ld=lld -Xlinker /MANIFEST:EMBED -Xlinker /natvis:"%~dp0\src\natvis\base.natvis" logo.res
|
||||
set cl_out= /out:
|
||||
|
||||
@@ -95,6 +95,21 @@ dbgi_hash_from_string(String8 string)
|
||||
return result;
|
||||
}
|
||||
|
||||
internal U64
|
||||
dbgi_fuzzy_item_num_from_array_element_idx__linear_search(DBGI_FuzzySearchItemArray *array, U64 element_idx)
|
||||
{
|
||||
U64 fuzzy_item_num = 0;
|
||||
for(U64 idx = 0; idx < array->count; idx += 1)
|
||||
{
|
||||
if(array->v[idx].idx == element_idx)
|
||||
{
|
||||
fuzzy_item_num = idx+1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return fuzzy_item_num;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Forced Override Cache Functions
|
||||
|
||||
@@ -1151,6 +1166,7 @@ dbgi_fuzzy_thread__entry_point(void *p)
|
||||
switch(target)
|
||||
{
|
||||
// NOTE(rjf): no default!
|
||||
case DBGI_FuzzySearchTarget_COUNT:{}break;
|
||||
case DBGI_FuzzySearchTarget_Procedures:
|
||||
{
|
||||
table_ptr_off = OffsetOf(RADDBG_Parsed, procedures);
|
||||
|
||||
@@ -378,6 +378,7 @@ internal void dbgi_ensure_tctx_inited(void);
|
||||
//~ rjf: Helpers
|
||||
|
||||
internal U64 dbgi_hash_from_string(String8 string);
|
||||
internal U64 dbgi_fuzzy_item_num_from_array_element_idx__linear_search(DBGI_FuzzySearchItemArray *array, U64 element_idx);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Forced Override Cache Functions
|
||||
|
||||
@@ -5534,6 +5534,61 @@ df_eval_viz_block_list_concat__in_place(DF_EvalVizBlockList *dst, DF_EvalVizBloc
|
||||
MemoryZeroStruct(to_push);
|
||||
}
|
||||
|
||||
internal DF_ExpandKey
|
||||
df_key_from_viz_block_idx_off(DF_EvalVizBlock *block, U64 idx_off)
|
||||
{
|
||||
DF_ExpandKey key = block->key;
|
||||
if(block->backing_search_items.v != 0)
|
||||
{
|
||||
if(idx_off < dim_1u64(block->semantic_idx_range) &&
|
||||
block->semantic_idx_range.min+idx_off < block->backing_search_items.count)
|
||||
{
|
||||
key.child_num = block->backing_search_items.v[block->semantic_idx_range.min+idx_off].idx;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
key.child_num = block->semantic_idx_range.min+1+idx_off;
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
internal B32
|
||||
df_viz_block_contains_key(DF_EvalVizBlock *block, DF_ExpandKey key)
|
||||
{
|
||||
B32 result = 0;
|
||||
if(block->backing_search_items.v != 0)
|
||||
{
|
||||
U64 item_num = dbgi_fuzzy_item_num_from_array_element_idx__linear_search(&block->backing_search_items, key.child_num);
|
||||
result = (item_num != 0 && contains_1u64(block->semantic_idx_range, item_num-1));
|
||||
}
|
||||
else
|
||||
{
|
||||
result = (block->semantic_idx_range.min+1 <= key.child_num && key.child_num < block->semantic_idx_range.max+1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
internal U64
|
||||
df_idx_off_from_viz_block_key(DF_EvalVizBlock *block, DF_ExpandKey key)
|
||||
{
|
||||
U64 idx_off = 0;
|
||||
if(block->backing_search_items.v != 0)
|
||||
{
|
||||
U64 item_num = dbgi_fuzzy_item_num_from_array_element_idx__linear_search(&block->backing_search_items, key.child_num);
|
||||
if(item_num != 0 && contains_1u64(block->semantic_idx_range, item_num-1))
|
||||
{
|
||||
U64 item_idx = item_num-1;
|
||||
idx_off = item_idx-block->semantic_idx_range.min;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
idx_off = key.child_num - (block->semantic_idx_range.min+1);
|
||||
}
|
||||
return idx_off;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Main State Accessors/Mutators
|
||||
|
||||
|
||||
@@ -1561,6 +1561,9 @@ internal DF_EvalLinkBaseArray df_eval_link_base_array_from_chunk_list(Arena *are
|
||||
internal void df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalView *view, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ExpandKey parent_key, DF_ExpandKey key, String8 string, DF_Eval eval, TG_Member *opt_member, DF_CfgTable *cfg_table, S32 depth, DF_EvalVizBlockList *list_out);
|
||||
internal DF_EvalVizBlockList df_eval_viz_block_list_from_eval_view_expr_num(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_EvalView *eval_view, String8 expr, U64 num);
|
||||
internal void df_eval_viz_block_list_concat__in_place(DF_EvalVizBlockList *dst, DF_EvalVizBlockList *to_push);
|
||||
internal DF_ExpandKey df_key_from_viz_block_idx_off(DF_EvalVizBlock *block, U64 idx);
|
||||
internal B32 df_viz_block_contains_key(DF_EvalVizBlock *block, DF_ExpandKey key);
|
||||
internal U64 df_idx_off_from_viz_block_key(DF_EvalVizBlock *block, DF_ExpandKey key);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Main State Accessors/Mutators
|
||||
|
||||
@@ -355,7 +355,8 @@ DF_CoreCmdTable:// | | |
|
||||
{FindCodeLocation 1 FilePath Nil 0 0 0 0 0 1 FileOutline "find_code_location" "Find Code Location" "Finds a specific source code location given file, line, and column coordinates. Opens the file if necessary." "" }
|
||||
|
||||
//- rjf: general-purpose view filtering
|
||||
{Filter 0 Null Nil 0 0 0 0 0 0 Find "filter" "Filter" "Applies a filter to the active view." "sort,search,filter,find" }
|
||||
{Filter 0 Null Nil 0 0 0 0 0 0 Find "filter" "Filter" "Begins filtering the active view." "sort,search,filter,find" }
|
||||
{ApplyFilter 0 Null Nil 0 0 0 0 0 0 Find "apply_filter" "Apply Filter" "Applies the typed filter to the active view." "sort,search,filter,find,apply" }
|
||||
{ClearFilter 0 Null Nil 0 0 0 0 0 0 Find "clear_filter" "Clear Filter" "Clears the filter applied to the active view." "sort,search,filter,find,clear" }
|
||||
|
||||
//- rjf: view drivers
|
||||
|
||||
@@ -179,7 +179,8 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[] =
|
||||
{ str8_lit_comp("entity_ref_fast_path"), str8_lit_comp("Activates the default behavior when clicking an entity reference."), str8_lit_comp(""), str8_lit_comp("Entity Reference Fast Path"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("spawn_entity_view"), str8_lit_comp("Spawns a new view, given an entity and other parameterizations."), str8_lit_comp(""), str8_lit_comp("Spawn Entity View"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("find_code_location"), str8_lit_comp("Finds a specific source code location given file, line, and column coordinates. Opens the file if necessary."), str8_lit_comp(""), str8_lit_comp("Find Code Location"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_FilePath, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_FileOutline},
|
||||
{ str8_lit_comp("filter"), str8_lit_comp("Applies a filter to the active view."), str8_lit_comp("sort,search,filter,find"), str8_lit_comp("Filter"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Find},
|
||||
{ str8_lit_comp("filter"), str8_lit_comp("Begins filtering the active view."), str8_lit_comp("sort,search,filter,find"), str8_lit_comp("Filter"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Find},
|
||||
{ str8_lit_comp("apply_filter"), str8_lit_comp("Applies the typed filter to the active view."), str8_lit_comp("sort,search,filter,find,apply"), str8_lit_comp("Apply Filter"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Find},
|
||||
{ str8_lit_comp("clear_filter"), str8_lit_comp("Clears the filter applied to the active view."), str8_lit_comp("sort,search,filter,find,clear"), str8_lit_comp("Clear Filter"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Find},
|
||||
{ str8_lit_comp("commands"), str8_lit_comp("Opens the list of all commands."), str8_lit_comp(""), str8_lit_comp("Commands"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_List},
|
||||
{ str8_lit_comp("target"), str8_lit_comp("Opens the editor for a target."), str8_lit_comp(""), str8_lit_comp("Target"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Target},
|
||||
|
||||
@@ -232,6 +232,7 @@ DF_CoreCmdKind_EntityRefFastPath,
|
||||
DF_CoreCmdKind_SpawnEntityView,
|
||||
DF_CoreCmdKind_FindCodeLocation,
|
||||
DF_CoreCmdKind_Filter,
|
||||
DF_CoreCmdKind_ApplyFilter,
|
||||
DF_CoreCmdKind_ClearFilter,
|
||||
DF_CoreCmdKind_Commands,
|
||||
DF_CoreCmdKind_Target,
|
||||
|
||||
+68
-38
@@ -2759,6 +2759,14 @@ df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, D
|
||||
view->query_cursor = view->query_mark = txt_pt(1, 1);
|
||||
}
|
||||
}break;
|
||||
case DF_CoreCmdKind_ApplyFilter:
|
||||
{
|
||||
DF_View *view = df_view_from_handle(params.view);
|
||||
if(!df_view_is_nil(view))
|
||||
{
|
||||
view->is_filtering = 0;
|
||||
}
|
||||
}break;
|
||||
|
||||
//- rjf: query completion
|
||||
case DF_CoreCmdKind_CompleteQuery:
|
||||
@@ -5321,7 +5329,6 @@ df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, D
|
||||
ui_set_next_hover_cursor(split_axis == Axis2_X ? OS_Cursor_LeftRight : OS_Cursor_UpDown);
|
||||
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable, "###%p_%p", min_child, max_child);
|
||||
UI_Signal sig = ui_signal_from_box(box);
|
||||
|
||||
if(sig.double_clicked)
|
||||
{
|
||||
ui_kill_action();
|
||||
@@ -5424,52 +5431,48 @@ df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, D
|
||||
//
|
||||
{
|
||||
DF_View *view = df_view_from_handle(panel->selected_tab_view);
|
||||
UI_Focus(UI_FocusKind_On) if(ui_is_focus_active() && view->spec->info.flags & DF_ViewSpecFlag_TypingAutomaticallyFilters && !view->is_filtering)
|
||||
{
|
||||
DF_CmdParams p = df_cmd_params_from_view(ws, panel, view);
|
||||
for(UI_NavActionNode *n = ui_nav_actions()->first, *next = 0; n != 0; n = next)
|
||||
{
|
||||
next = n->next;
|
||||
if(n->v.flags & UI_NavActionFlag_Paste)
|
||||
{
|
||||
ui_nav_eat_action_node(ui_nav_actions(), n);
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Filter));
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Paste));
|
||||
}
|
||||
else if(n->v.insertion.size != 0)
|
||||
{
|
||||
ui_nav_eat_action_node(ui_nav_actions(), n);
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Filter));
|
||||
p.string = n->v.insertion;
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_InsertText));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(view->is_filtering || view->is_filtering_t > 0.01f) UI_Focus(view->is_filtering ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
{
|
||||
UI_Box *filter_box = &ui_g_nil_box;
|
||||
UI_Rect(filter_rect)
|
||||
{
|
||||
filter_box = ui_build_box_from_stringf(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBorder, "filter_box_%p", view);
|
||||
ui_set_next_child_layout_axis(Axis2_X);
|
||||
filter_box = ui_build_box_from_stringf(UI_BoxFlag_DrawBackground|UI_BoxFlag_Clip|UI_BoxFlag_DrawBorder, "filter_box_%p", view);
|
||||
}
|
||||
UI_Parent(filter_box) UI_WidthFill UI_HeightFill UI_Font(df_font_from_slot(DF_FontSlot_Code))
|
||||
UI_Parent(filter_box) UI_WidthFill UI_HeightFill
|
||||
{
|
||||
if(ui_is_focus_active() && os_key_press(ui_events(), ui_window(), 0, OS_Key_Esc))
|
||||
{
|
||||
DF_CmdParams p = df_cmd_params_from_view(ws, panel, view);
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ClearFilter));
|
||||
}
|
||||
UI_Signal sig = df_line_edit(DF_LineEditFlag_Border|DF_LineEditFlag_CodeContents,
|
||||
0,
|
||||
0,
|
||||
&view->query_cursor,
|
||||
&view->query_mark,
|
||||
view->query_buffer,
|
||||
sizeof(view->query_buffer),
|
||||
&view->query_string_size,
|
||||
0,
|
||||
str8(view->query_buffer, view->query_string_size),
|
||||
str8_lit("###filter_text_input"));
|
||||
if(ui_is_focus_active() && os_key_press(ui_events(), ui_window(), 0, OS_Key_Return))
|
||||
{
|
||||
DF_CmdParams p = df_cmd_params_from_view(ws, panel, view);
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ApplyFilter));
|
||||
}
|
||||
UI_PrefWidth(ui_em(2.f, 1.f)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText))
|
||||
UI_Font(df_font_from_slot(DF_FontSlot_Icons))
|
||||
ui_label(df_g_icon_kind_text_table[DF_IconKind_Find]);
|
||||
UI_PrefWidth(ui_text_dim(10, 1))
|
||||
{
|
||||
ui_label(str8_lit("Filter"));
|
||||
}
|
||||
ui_spacer(ui_em(0.5f, 1.f));
|
||||
UI_Font(df_font_from_slot(DF_FontSlot_Code))
|
||||
{
|
||||
UI_Signal sig = df_line_edit(DF_LineEditFlag_Border|DF_LineEditFlag_CodeContents,
|
||||
0,
|
||||
0,
|
||||
&view->query_cursor,
|
||||
&view->query_mark,
|
||||
view->query_buffer,
|
||||
sizeof(view->query_buffer),
|
||||
&view->query_string_size,
|
||||
0,
|
||||
str8(view->query_buffer, view->query_string_size),
|
||||
str8_lit("###filter_text_input"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5630,12 +5633,39 @@ df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, D
|
||||
UI_Parent(view_container_box) if(!df_view_is_nil(df_view_from_handle(panel->selected_tab_view)))
|
||||
{
|
||||
DF_View *view = df_view_from_handle(panel->selected_tab_view);
|
||||
DF_ViewSpec *view_spec = view->spec;
|
||||
DF_ViewUIFunctionType *build_view_ui_function = view_spec->info.ui_hook;
|
||||
DF_ViewUIFunctionType *build_view_ui_function = view->spec->info.ui_hook;
|
||||
build_view_ui_function(ws, panel, view, content_rect);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
//- rjf: take events to automatically start filtering, if applicable
|
||||
//
|
||||
{
|
||||
DF_View *view = df_view_from_handle(panel->selected_tab_view);
|
||||
UI_Focus(UI_FocusKind_On) if(ui_is_focus_active() && view->spec->info.flags & DF_ViewSpecFlag_TypingAutomaticallyFilters && !view->is_filtering)
|
||||
{
|
||||
DF_CmdParams p = df_cmd_params_from_view(ws, panel, view);
|
||||
for(UI_NavActionNode *n = ui_nav_actions()->first, *next = 0; n != 0; n = next)
|
||||
{
|
||||
next = n->next;
|
||||
if(n->v.flags & UI_NavActionFlag_Paste)
|
||||
{
|
||||
ui_nav_eat_action_node(ui_nav_actions(), n);
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Filter));
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Paste));
|
||||
}
|
||||
else if(n->v.insertion.size != 0)
|
||||
{
|
||||
ui_nav_eat_action_node(ui_nav_actions(), n);
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Filter));
|
||||
p.string = n->v.insertion;
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_InsertText));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
//- rjf: consume panel fallthrough interaction events
|
||||
//
|
||||
@@ -7644,7 +7674,7 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
// rjf: get keys for this row
|
||||
DF_ExpandKey parent_key = block->parent_key;
|
||||
DF_ExpandKey key = block->key;
|
||||
key.child_num = idx+1;
|
||||
key.child_num = block->backing_search_items.v[idx].idx;
|
||||
|
||||
// rjf: get eval for this type
|
||||
DF_Eval eval = df_eval_from_string(arena, scope, ctrl_ctx, parse_ctx, name);
|
||||
|
||||
+18
-26
@@ -644,11 +644,7 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DBGI_Scope *scope, DF
|
||||
DF_EvalVizBlockList blocks = {0};
|
||||
DF_EvalViewKey eval_view_key = df_eval_view_key_from_eval_watch_view(ews);
|
||||
DF_EvalView *eval_view = df_eval_view_from_key(eval_view_key);
|
||||
String8 filter = {0};
|
||||
if(view->is_filtering)
|
||||
{
|
||||
filter = str8(view->query_buffer, view->query_string_size);
|
||||
}
|
||||
String8 filter = str8(view->query_buffer, view->query_string_size);
|
||||
switch(ews->fill_kind)
|
||||
{
|
||||
////////////////////////////
|
||||
@@ -940,11 +936,11 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DBGI_Scope *scope, DF
|
||||
DF_Entity *module = df_module_from_process_vaddr(process, thread_rip_unwind_vaddr);
|
||||
DF_Entity *binary = df_binary_file_from_module(module);
|
||||
String8 exe_path = df_full_path_from_entity(scratch.arena, binary);
|
||||
|
||||
// rjf: query all filtered globals from dbgi searching system
|
||||
U128 fuzzy_search_key = {(U64)view, df_hash_from_string(str8_struct(&view))};
|
||||
DBGI_Parse *dbgi = dbgi_parse_from_exe_path(scope, exe_path, os_now_microseconds()+100);
|
||||
RADDBG_Parsed *rdbg = &dbgi->rdbg;
|
||||
|
||||
// rjf: query all filtered user-defined-types from dbgi searching system
|
||||
U128 fuzzy_search_key = {(U64)view, df_hash_from_string(str8_struct(&view))};
|
||||
B32 items_stale = 0;
|
||||
DBGI_FuzzySearchItemArray items = dbgi_fuzzy_search_items_from_key_exe_query(scope, fuzzy_search_key, exe_path, filter, DBGI_FuzzySearchTarget_UDTs, os_now_microseconds()+100, &items_stale);
|
||||
if(items_stale)
|
||||
@@ -972,15 +968,16 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DBGI_Scope *scope, DF
|
||||
for(DF_ExpandNode *child = root_node->first; child != 0; child = child->next)
|
||||
{
|
||||
U64 child_num = child->key.child_num;
|
||||
U64 child_idx = child_num-1;
|
||||
if(child_idx >= items.count)
|
||||
U64 item_num = dbgi_fuzzy_item_num_from_array_element_idx__linear_search(&items, child_num);
|
||||
if(item_num == 0 || !contains_1u64(types_block->semantic_idx_range, item_num-1))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
U64 item_idx = item_num-1;
|
||||
|
||||
// rjf: truncate existing memblock
|
||||
types_block->visual_idx_range.max = child_idx;
|
||||
types_block->semantic_idx_range.max = child_idx;
|
||||
types_block->visual_idx_range.max = item_idx;
|
||||
types_block->semantic_idx_range.max = item_idx;
|
||||
|
||||
// rjf: build inheriting cfg table
|
||||
DF_CfgTable child_cfg = {0};
|
||||
@@ -993,7 +990,7 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DBGI_Scope *scope, DF
|
||||
}
|
||||
|
||||
// rjf: unpack types
|
||||
RADDBG_UDT *udt = raddbg_element_from_idx(parse_ctx->rdbg, udts, items.v[child_idx].idx);
|
||||
RADDBG_UDT *udt = raddbg_element_from_idx(parse_ctx->rdbg, udts, child_num);
|
||||
RADDBG_TypeNode *type_node = raddbg_element_from_idx(parse_ctx->rdbg, type_nodes, udt->self_type_idx);
|
||||
U64 name_size = 0;
|
||||
U8 *name_base = raddbg_string_from_idx(parse_ctx->rdbg, type_node->user_defined.name_string_idx, &name_size);
|
||||
@@ -1010,12 +1007,12 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DBGI_Scope *scope, DF
|
||||
}
|
||||
|
||||
// rjf: make new memblock for remainder (if any)
|
||||
if(child_idx+1 < items.count)
|
||||
if(item_idx+1 < items.count)
|
||||
{
|
||||
DF_EvalVizBlock *next_types_block = push_array(arena, DF_EvalVizBlock, 1);
|
||||
next_types_block->kind = DF_EvalVizBlockKind_AllTypes;
|
||||
next_types_block->visual_idx_range = r1u64(child_idx+1, items.count);
|
||||
next_types_block->semantic_idx_range= r1u64(child_idx+1, items.count);
|
||||
next_types_block->visual_idx_range = r1u64(item_idx+1, items.count);
|
||||
next_types_block->semantic_idx_range= r1u64(item_idx+1, items.count);
|
||||
next_types_block->depth = 0;
|
||||
next_types_block->parent_key = parent_key;
|
||||
next_types_block->key = root_key;
|
||||
@@ -1098,11 +1095,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
U64 thread_ip_vaddr = df_query_cached_rip_from_thread_unwind(thread, ctrl_ctx.unwind_count);
|
||||
DF_EvalViewKey eval_view_key = df_eval_view_key_from_eval_watch_view(ewv);
|
||||
DF_EvalView *eval_view = df_eval_view_from_key(eval_view_key);
|
||||
String8 filter = {0};
|
||||
if(view->is_filtering)
|
||||
{
|
||||
filter = str8(view->query_buffer, view->query_string_size);
|
||||
}
|
||||
String8 filter = str8(view->query_buffer, view->query_string_size);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: process * thread info -> parse_ctx
|
||||
@@ -1136,11 +1129,10 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
{
|
||||
if(df_expand_key_match(block->parent_key, ewv->selected_parent_key) &&
|
||||
block->key.parent_hash == ewv->selected_key.parent_hash &&
|
||||
block->semantic_idx_range.min+1 <= ewv->selected_key.child_num &&
|
||||
ewv->selected_key.child_num < block->semantic_idx_range.max+1)
|
||||
df_viz_block_contains_key(block, ewv->selected_key))
|
||||
{
|
||||
key_found = 1;
|
||||
cursor.y += ewv->selected_key.child_num - (block->semantic_idx_range.min+1);
|
||||
cursor.y += df_idx_off_from_viz_block_key(block, ewv->selected_key);
|
||||
break;
|
||||
}
|
||||
else
|
||||
@@ -1990,7 +1982,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
block_before_found = prev;
|
||||
found_block = block;
|
||||
ewv->selected_parent_key = block->parent_key;
|
||||
ewv->selected_key = df_expand_key_make(block->key.parent_hash, (cursor.y - scan_y) + block->semantic_idx_range.min + 1);
|
||||
ewv->selected_key = df_key_from_viz_block_idx_off(block, cursor.y-scan_y);
|
||||
break;
|
||||
}
|
||||
scan_y += advance;
|
||||
@@ -6952,7 +6944,7 @@ DF_VIEW_UI_FUNCTION_DEF(Watch)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
DF_EvalWatchViewState *ewv = df_view_user_state(view, DF_EvalWatchViewState);
|
||||
df_eval_watch_view_build(ws, panel, view, ewv, 1*!view->is_filtering, 10, rect);
|
||||
df_eval_watch_view_build(ws, panel, view, ewv, 1*(view->query_string_size == 0), 10, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user