mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 13:58:40 +00:00
further progress on targets view replacement; split collection views into several types
This commit is contained in:
@@ -675,6 +675,38 @@ str8_lit_comp("5"),
|
|||||||
str8_lit_comp("c"),
|
str8_lit_comp("c"),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
String8 rd_collection_name_table[12] =
|
||||||
|
{
|
||||||
|
str8_lit_comp("watches"),
|
||||||
|
str8_lit_comp("targets"),
|
||||||
|
str8_lit_comp("breakpoints"),
|
||||||
|
str8_lit_comp("watch_pins"),
|
||||||
|
str8_lit_comp("threads"),
|
||||||
|
str8_lit_comp("modules"),
|
||||||
|
str8_lit_comp("locals"),
|
||||||
|
str8_lit_comp("registers"),
|
||||||
|
str8_lit_comp("globals"),
|
||||||
|
str8_lit_comp("thread_locals"),
|
||||||
|
str8_lit_comp("types"),
|
||||||
|
str8_lit_comp("procedures"),
|
||||||
|
};
|
||||||
|
|
||||||
|
EV_ViewRuleBlockProdHookFunctionType * rd_collection_block_prod_hook_function_table[12] =
|
||||||
|
{
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(watches),
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(targets),
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(breakpoints),
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(watch_pins),
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(threads),
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(modules),
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(locals),
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(registers),
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(globals),
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(thread_locals),
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(types),
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(procedures),
|
||||||
|
};
|
||||||
|
|
||||||
RD_ViewRuleInfo rd_view_rule_kind_info_table[34] =
|
RD_ViewRuleInfo rd_view_rule_kind_info_table[34] =
|
||||||
{
|
{
|
||||||
{{0}, {0}, {0}, {0}, RD_IconKind_Null, 0, 0, RD_VIEW_RULE_UI_FUNCTION_NAME(null)},
|
{{0}, {0}, {0}, {0}, RD_IconKind_Null, 0, 0, RD_VIEW_RULE_UI_FUNCTION_NAME(null)},
|
||||||
|
|||||||
@@ -648,6 +648,18 @@ RD_ViewRuleUIFunctionType *ui;
|
|||||||
.params_tree = rd_regs()->params_tree,\
|
.params_tree = rd_regs()->params_tree,\
|
||||||
.os_event = rd_regs()->os_event,\
|
.os_event = rd_regs()->os_event,\
|
||||||
|
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(watches);
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(targets);
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(breakpoints);
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(watch_pins);
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(threads);
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(modules);
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(locals);
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(registers);
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(globals);
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(thread_locals);
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(types);
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(procedures);
|
||||||
RD_VIEW_RULE_UI_FUNCTION_DEF(null);
|
RD_VIEW_RULE_UI_FUNCTION_DEF(null);
|
||||||
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(text);
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(text);
|
||||||
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(disasm);
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(disasm);
|
||||||
@@ -704,6 +716,8 @@ extern RD_StringBindingPair rd_default_binding_table[110];
|
|||||||
extern String8 rd_binding_version_remap_old_name_table[7];
|
extern String8 rd_binding_version_remap_old_name_table[7];
|
||||||
extern String8 rd_binding_version_remap_new_name_table[7];
|
extern String8 rd_binding_version_remap_new_name_table[7];
|
||||||
extern String8 rd_icon_kind_text_table[69];
|
extern String8 rd_icon_kind_text_table[69];
|
||||||
|
extern String8 rd_collection_name_table[12];
|
||||||
|
extern EV_ViewRuleBlockProdHookFunctionType * rd_collection_block_prod_hook_function_table[12];
|
||||||
extern RD_ViewRuleInfo rd_view_rule_kind_info_table[34];
|
extern RD_ViewRuleInfo rd_view_rule_kind_info_table[34];
|
||||||
extern RD_IconKind rd_entity_kind_icon_kind_table[30];
|
extern RD_IconKind rd_entity_kind_icon_kind_table[30];
|
||||||
extern String8 rd_theme_preset_display_string_table[9];
|
extern String8 rd_theme_preset_display_string_table[9];
|
||||||
|
|||||||
@@ -820,6 +820,41 @@ RD_IconTable:
|
|||||||
@expand(RD_IconTable a) `str8_lit_comp("$(a.text)")`;
|
@expand(RD_IconTable a) `str8_lit_comp("$(a.text)")`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: Collections
|
||||||
|
|
||||||
|
@table(name)
|
||||||
|
RD_CollectionTable:
|
||||||
|
{
|
||||||
|
{watches}
|
||||||
|
{targets}
|
||||||
|
{breakpoints}
|
||||||
|
{watch_pins}
|
||||||
|
{threads}
|
||||||
|
{modules}
|
||||||
|
{locals}
|
||||||
|
{registers}
|
||||||
|
{globals}
|
||||||
|
{thread_locals}
|
||||||
|
{types}
|
||||||
|
{procedures}
|
||||||
|
}
|
||||||
|
|
||||||
|
@gen
|
||||||
|
{
|
||||||
|
@expand(RD_CollectionTable a) `EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF($(a.name));`
|
||||||
|
}
|
||||||
|
|
||||||
|
@data(String8) rd_collection_name_table:
|
||||||
|
{
|
||||||
|
@expand(RD_CollectionTable a) `str8_lit_comp("$(a.name)")`
|
||||||
|
}
|
||||||
|
|
||||||
|
@data(`EV_ViewRuleBlockProdHookFunctionType *`) rd_collection_block_prod_hook_function_table:
|
||||||
|
{
|
||||||
|
@expand(RD_CollectionTable a) `EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME($(a.name))`
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: View Rules
|
//~ rjf: View Rules
|
||||||
|
|
||||||
|
|||||||
+83
-75
@@ -1705,6 +1705,35 @@ rd_entity_from_name_and_kind(String8 string, RD_EntityKind kind)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: Frontend Entity Info Extraction
|
||||||
|
|
||||||
|
internal DR_FancyStringList
|
||||||
|
rd_title_fstrs_from_entity(Arena *arena, RD_Entity *entity, Vec4F32 secondary_color, F32 size)
|
||||||
|
{
|
||||||
|
DR_FancyStringList result = {0};
|
||||||
|
RD_IconKind icon_kind = rd_entity_kind_icon_kind_table[entity->kind];
|
||||||
|
Vec4F32 color = rd_rgba_from_theme_color(RD_ThemeColor_Text);
|
||||||
|
if(icon_kind != RD_IconKind_Null)
|
||||||
|
{
|
||||||
|
dr_fancy_string_list_push_new(arena, &result, rd_font_from_slot(RD_FontSlot_Icons), size, secondary_color, rd_icon_kind_text_table[icon_kind]);
|
||||||
|
}
|
||||||
|
dr_fancy_string_list_push_new(arena, &result, rd_font_from_slot(RD_FontSlot_Code), size, secondary_color, str8_lit(" "));
|
||||||
|
String8 name = entity->string;
|
||||||
|
B32 name_is_code = 1;
|
||||||
|
if(name.size == 0)
|
||||||
|
{
|
||||||
|
RD_Entity *exe = rd_entity_child_from_kind(entity, RD_EntityKind_Executable);
|
||||||
|
if(!rd_entity_is_nil(exe))
|
||||||
|
{
|
||||||
|
name = str8_skip_last_slash(exe->string);
|
||||||
|
name_is_code = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dr_fancy_string_list_push_new(arena, &result, rd_font_from_slot(name_is_code ? RD_FontSlot_Code : RD_FontSlot_Main), size, color, name);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: Control Entity Info Extraction
|
//~ rjf: Control Entity Info Extraction
|
||||||
|
|
||||||
@@ -7868,12 +7897,7 @@ rd_window_frame(RD_Window *ws)
|
|||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: Eval Visualization
|
//~ rjf: Eval Visualization
|
||||||
|
|
||||||
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(rd_collection_block_prod)
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(watches)
|
||||||
{
|
|
||||||
//////////////////////////////
|
|
||||||
//- rjf: watches
|
|
||||||
//
|
|
||||||
if(str8_match(string, str8_lit("watches"), 0))
|
|
||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
RD_EntityList watches = rd_query_cached_entity_list_with_kind(RD_EntityKind_Watch);
|
RD_EntityList watches = rd_query_cached_entity_list_with_kind(RD_EntityKind_Watch);
|
||||||
@@ -7894,10 +7918,7 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(rd_collection_block_prod)
|
|||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(targets)
|
||||||
//- rjf: targets
|
|
||||||
//
|
|
||||||
else if(str8_match(string, str8_lit("targets"), 0))
|
|
||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
RD_EntityList targets = rd_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
RD_EntityList targets = rd_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
||||||
@@ -7914,10 +7935,7 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(rd_collection_block_prod)
|
|||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(breakpoints)
|
||||||
//- rjf: breakpoints
|
|
||||||
//
|
|
||||||
else if(str8_match(string, str8_lit("breakpoints"), 0))
|
|
||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
RD_EntityList bps = rd_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint);
|
RD_EntityList bps = rd_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint);
|
||||||
@@ -7934,10 +7952,7 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(rd_collection_block_prod)
|
|||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(watch_pins)
|
||||||
//- rjf: watch_pins
|
|
||||||
//
|
|
||||||
else if(str8_match(string, str8_lit("watch_pins"), 0))
|
|
||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
RD_EntityList wps = rd_query_cached_entity_list_with_kind(RD_EntityKind_WatchPin);
|
RD_EntityList wps = rd_query_cached_entity_list_with_kind(RD_EntityKind_WatchPin);
|
||||||
@@ -7954,10 +7969,7 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(rd_collection_block_prod)
|
|||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(threads)
|
||||||
//- rjf: threads
|
|
||||||
//
|
|
||||||
else if(str8_match(string, str8_lit("threads"), 0))
|
|
||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
CTRL_EntityList entities = ctrl_entity_list_from_kind(d_state->ctrl_entity_store, CTRL_EntityKind_Thread);
|
CTRL_EntityList entities = ctrl_entity_list_from_kind(d_state->ctrl_entity_store, CTRL_EntityKind_Thread);
|
||||||
@@ -7974,10 +7986,7 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(rd_collection_block_prod)
|
|||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(modules)
|
||||||
//- rjf: modules
|
|
||||||
//
|
|
||||||
else if(str8_match(string, str8_lit("modules"), 0))
|
|
||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
CTRL_EntityList entities = ctrl_entity_list_from_kind(d_state->ctrl_entity_store, CTRL_EntityKind_Module);
|
CTRL_EntityList entities = ctrl_entity_list_from_kind(d_state->ctrl_entity_store, CTRL_EntityKind_Module);
|
||||||
@@ -7994,10 +8003,7 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(rd_collection_block_prod)
|
|||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(locals)
|
||||||
//- rjf: locals
|
|
||||||
//
|
|
||||||
else if(str8_match(string, str8_lit("locals"), 0))
|
|
||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
E_String2NumMapNodeArray nodes = e_string2num_map_node_array_from_map(scratch.arena, e_parse_ctx->locals_map);
|
E_String2NumMapNodeArray nodes = e_string2num_map_node_array_from_map(scratch.arena, e_parse_ctx->locals_map);
|
||||||
@@ -8019,10 +8025,7 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(rd_collection_block_prod)
|
|||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(registers)
|
||||||
//- rjf: registers
|
|
||||||
//
|
|
||||||
else if(str8_match(string, str8_lit("registers"), 0))
|
|
||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
CTRL_Entity *thread = ctrl_entity_from_handle(d_state->ctrl_entity_store, rd_regs()->thread);
|
CTRL_Entity *thread = ctrl_entity_from_handle(d_state->ctrl_entity_store, rd_regs()->thread);
|
||||||
@@ -8061,21 +8064,31 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(rd_collection_block_prod)
|
|||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(globals)
|
||||||
//- rjf: debug info tables
|
{
|
||||||
//
|
rd_ev_view_rule_block_prod_collection_debug_tables(arena, RDI_SectionKind_GlobalVariables, view, filter, parent_key, key, expand_node, string, expr, view_rules, view_params, depth, out);
|
||||||
else if(str8_match(string, str8_lit("globals"), 0) ||
|
}
|
||||||
str8_match(string, str8_lit("thread_locals"), 0) ||
|
|
||||||
str8_match(string, str8_lit("types"), 0) ||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(thread_locals)
|
||||||
str8_match(string, str8_lit("procedures"), 0))
|
{
|
||||||
|
rd_ev_view_rule_block_prod_collection_debug_tables(arena, RDI_SectionKind_ThreadVariables, view, filter, parent_key, key, expand_node, string, expr, view_rules, view_params, depth, out);
|
||||||
|
}
|
||||||
|
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(types)
|
||||||
|
{
|
||||||
|
rd_ev_view_rule_block_prod_collection_debug_tables(arena, RDI_SectionKind_UDTs, view, filter, parent_key, key, expand_node, string, expr, view_rules, view_params, depth, out);
|
||||||
|
}
|
||||||
|
|
||||||
|
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(procedures)
|
||||||
|
{
|
||||||
|
rd_ev_view_rule_block_prod_collection_debug_tables(arena, RDI_SectionKind_Procedures, view, filter, parent_key, key, expand_node, string, expr, view_rules, view_params, depth, out);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void
|
||||||
|
rd_ev_view_rule_block_prod_collection_debug_tables(Arena *arena, RDI_SectionKind target, EV_View *view, String8 filter, EV_Key parent_key, EV_Key key, EV_ExpandNode *expand_node, String8 string, E_Expr *expr, EV_ViewRuleList *view_rules, MD_Node *view_params, S32 depth, struct EV_BlockList *out)
|
||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
RDI_SectionKind fzy_target = (str8_match(string, str8_lit("globals"), 0) ? RDI_SectionKind_GlobalVariables :
|
if(target != RDI_SectionKind_NULL)
|
||||||
str8_match(string, str8_lit("thread_locals"), 0) ? RDI_SectionKind_ThreadVariables :
|
|
||||||
str8_match(string, str8_lit("types"), 0) ? RDI_SectionKind_UDTs :
|
|
||||||
str8_match(string, str8_lit("procedures"), 0) ? RDI_SectionKind_Procedures :
|
|
||||||
RDI_SectionKind_NULL);
|
|
||||||
if(fzy_target != RDI_SectionKind_NULL)
|
|
||||||
{
|
{
|
||||||
U64 endt_us = os_now_microseconds()+200;
|
U64 endt_us = os_now_microseconds()+200;
|
||||||
|
|
||||||
@@ -8095,7 +8108,7 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(rd_collection_block_prod)
|
|||||||
//- rjf: query all filtered items from dbgi searching system
|
//- rjf: query all filtered items from dbgi searching system
|
||||||
U128 fuzzy_search_key = {rd_regs()->view.u64[0], d_hash_from_seed_string(ev_hash_from_key(key), string)};
|
U128 fuzzy_search_key = {rd_regs()->view.u64[0], d_hash_from_seed_string(ev_hash_from_key(key), string)};
|
||||||
B32 items_stale = 0;
|
B32 items_stale = 0;
|
||||||
FZY_Params params = {fzy_target, dbgi_keys};
|
FZY_Params params = {target, dbgi_keys};
|
||||||
FZY_ItemArray items = fzy_items_from_key_params_query(rd_state->frame_fzy_scope, fuzzy_search_key, ¶ms, filter, endt_us, &items_stale);
|
FZY_ItemArray items = fzy_items_from_key_params_query(rd_state->frame_fzy_scope, fuzzy_search_key, ¶ms, filter, endt_us, &items_stale);
|
||||||
if(items_stale)
|
if(items_stale)
|
||||||
{
|
{
|
||||||
@@ -8167,7 +8180,7 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(rd_collection_block_prod)
|
|||||||
EV_Block *last_vb = ev_block_begin(arena, EV_BlockKind_DebugInfoTable, key, ev_key_make(ev_hash_from_key(key), 0), depth);
|
EV_Block *last_vb = ev_block_begin(arena, EV_BlockKind_DebugInfoTable, key, ev_key_make(ev_hash_from_key(key), 0), depth);
|
||||||
{
|
{
|
||||||
last_vb->visual_idx_range = last_vb->semantic_idx_range = r1u64(0, items.count);
|
last_vb->visual_idx_range = last_vb->semantic_idx_range = r1u64(0, items.count);
|
||||||
last_vb->fzy_target = fzy_target;
|
last_vb->fzy_target = target;
|
||||||
last_vb->fzy_backing_items = items;
|
last_vb->fzy_backing_items = items;
|
||||||
}
|
}
|
||||||
for(U64 sub_expand_idx = 0; sub_expand_idx < sub_expand_keys_count; sub_expand_idx += 1)
|
for(U64 sub_expand_idx = 0; sub_expand_idx < sub_expand_keys_count; sub_expand_idx += 1)
|
||||||
@@ -8196,8 +8209,6 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(rd_collection_block_prod)
|
|||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
internal EV_View *
|
internal EV_View *
|
||||||
rd_ev_view_from_key(U64 key)
|
rd_ev_view_from_key(U64 key)
|
||||||
{
|
{
|
||||||
@@ -10643,10 +10654,18 @@ rd_frame(void)
|
|||||||
}
|
}
|
||||||
e_select_parse_ctx(parse_ctx);
|
e_select_parse_ctx(parse_ctx);
|
||||||
|
|
||||||
|
////////////////////////////
|
||||||
|
//- rjf: create names/type-info for debugger collections
|
||||||
|
//
|
||||||
|
E_TypeKey collection_type_keys[ArrayCount(rd_collection_name_table)] = {0};
|
||||||
|
for EachElement(idx, rd_collection_name_table)
|
||||||
|
{
|
||||||
|
collection_type_keys[idx] = e_type_key_cons(.kind = E_TypeKind_Collection, .name = rd_collection_name_table[idx]);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////
|
////////////////////////////
|
||||||
//- rjf: build eval IR context
|
//- rjf: build eval IR context
|
||||||
//
|
//
|
||||||
E_TypeKey collection_type_key = e_type_key_cons(.kind = E_TypeKind_Collection, .name = str8_lit("collection"));
|
|
||||||
E_TypeKey meta_eval_type_key = e_type_key_cons_base(type(CTRL_MetaEval));
|
E_TypeKey meta_eval_type_key = e_type_key_cons_base(type(CTRL_MetaEval));
|
||||||
E_IRCtx *ir_ctx = push_array(scratch.arena, E_IRCtx, 1);
|
E_IRCtx *ir_ctx = push_array(scratch.arena, E_IRCtx, 1);
|
||||||
{
|
{
|
||||||
@@ -10656,28 +10675,13 @@ rd_frame(void)
|
|||||||
|
|
||||||
//- rjf: add macros for collections
|
//- rjf: add macros for collections
|
||||||
{
|
{
|
||||||
String8 collection_names[] =
|
for EachElement(idx, rd_collection_name_table)
|
||||||
{
|
|
||||||
str8_lit_comp("watches"),
|
|
||||||
str8_lit_comp("targets"),
|
|
||||||
str8_lit_comp("breakpoints"),
|
|
||||||
str8_lit_comp("watch_pins"),
|
|
||||||
str8_lit_comp("threads"),
|
|
||||||
str8_lit_comp("modules"),
|
|
||||||
str8_lit_comp("locals"),
|
|
||||||
str8_lit_comp("registers"),
|
|
||||||
str8_lit_comp("globals"),
|
|
||||||
str8_lit_comp("thread_locals"),
|
|
||||||
str8_lit_comp("types"),
|
|
||||||
str8_lit_comp("procedures"),
|
|
||||||
};
|
|
||||||
for EachElement(idx, collection_names)
|
|
||||||
{
|
{
|
||||||
E_Expr *expr = e_push_expr(scratch.arena, E_ExprKind_LeafOffset, 0);
|
E_Expr *expr = e_push_expr(scratch.arena, E_ExprKind_LeafOffset, 0);
|
||||||
expr->space = e_space_make(RD_EvalSpaceKind_MetaCollection);
|
expr->space = e_space_make(RD_EvalSpaceKind_MetaCollection);
|
||||||
expr->mode = E_Mode_Null;
|
expr->mode = E_Mode_Null;
|
||||||
expr->type_key = collection_type_key;
|
expr->type_key = collection_type_keys[idx];
|
||||||
e_string2expr_map_insert(scratch.arena, ctx->macro_map, collection_names[idx], expr);
|
e_string2expr_map_insert(scratch.arena, ctx->macro_map, rd_collection_name_table[idx], expr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -10785,16 +10789,17 @@ rd_frame(void)
|
|||||||
{
|
{
|
||||||
ev_view_rule_info_table_push_builtins(scratch.arena, view_rule_info_table);
|
ev_view_rule_info_table_push_builtins(scratch.arena, view_rule_info_table);
|
||||||
|
|
||||||
// rjf: collection view rule
|
// rjf: collection view rules
|
||||||
|
for EachElement(idx, rd_collection_name_table)
|
||||||
{
|
{
|
||||||
EV_ViewRuleInfo info = {0};
|
EV_ViewRuleInfo info = {0};
|
||||||
info.string = str8_lit("collection");
|
info.string = rd_collection_name_table[idx];
|
||||||
info.flags = EV_ViewRuleInfoFlag_Expandable;
|
info.flags = EV_ViewRuleInfoFlag_Expandable;
|
||||||
info.block_prod = EV_VIEW_RULE_BLOCK_PROD_FUNCTION_NAME(rd_collection_block_prod);
|
info.block_prod = rd_collection_block_prod_hook_function_table[idx];
|
||||||
ev_view_rule_info_table_push(scratch.arena, view_rule_info_table, &info);
|
ev_view_rule_info_table_push(scratch.arena, view_rule_info_table, &info);
|
||||||
}
|
}
|
||||||
|
|
||||||
// rjf: raddbg-layer view rules
|
// rjf: visualizer view rules
|
||||||
for EachEnumVal(RD_ViewRuleKind, k)
|
for EachEnumVal(RD_ViewRuleKind, k)
|
||||||
{
|
{
|
||||||
RD_ViewRuleInfo *src_info = &rd_view_rule_kind_info_table[k];
|
RD_ViewRuleInfo *src_info = &rd_view_rule_kind_info_table[k];
|
||||||
@@ -10816,7 +10821,10 @@ rd_frame(void)
|
|||||||
EV_AutoViewRuleTable *auto_view_rule_table = push_array(scratch.arena, EV_AutoViewRuleTable, 1);
|
EV_AutoViewRuleTable *auto_view_rule_table = push_array(scratch.arena, EV_AutoViewRuleTable, 1);
|
||||||
{
|
{
|
||||||
ev_auto_view_rule_table_push_new(scratch.arena, auto_view_rule_table, e_type_key_cons_base(type(CTRL_MetaEvalFrameArray)), str8_lit("slice"));
|
ev_auto_view_rule_table_push_new(scratch.arena, auto_view_rule_table, e_type_key_cons_base(type(CTRL_MetaEvalFrameArray)), str8_lit("slice"));
|
||||||
ev_auto_view_rule_table_push_new(scratch.arena, auto_view_rule_table, collection_type_key, str8_lit("collection"));
|
for EachElement(idx, rd_collection_name_table)
|
||||||
|
{
|
||||||
|
ev_auto_view_rule_table_push_new(scratch.arena, auto_view_rule_table, collection_type_keys[idx], rd_collection_name_table[idx]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ev_select_auto_view_rule_table(auto_view_rule_table);
|
ev_select_auto_view_rule_table(auto_view_rule_table);
|
||||||
|
|
||||||
|
|||||||
@@ -1155,6 +1155,11 @@ internal RD_Entity *rd_entity_from_ctrl_handle(CTRL_Handle handle);
|
|||||||
internal RD_Entity *rd_entity_from_ctrl_id(CTRL_MachineID machine_id, U32 id);
|
internal RD_Entity *rd_entity_from_ctrl_id(CTRL_MachineID machine_id, U32 id);
|
||||||
internal RD_Entity *rd_entity_from_name_and_kind(String8 string, RD_EntityKind kind);
|
internal RD_Entity *rd_entity_from_name_and_kind(String8 string, RD_EntityKind kind);
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: Frontend Entity Info Extraction
|
||||||
|
|
||||||
|
internal DR_FancyStringList rd_title_fstrs_from_entity(Arena *arena, RD_Entity *entity, Vec4F32 secondary_color, F32 size);
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: Control Entity Info Extraction
|
//~ rjf: Control Entity Info Extraction
|
||||||
|
|
||||||
@@ -1275,7 +1280,7 @@ internal void rd_window_frame(RD_Window *ws);
|
|||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: Eval Visualization
|
//~ rjf: Eval Visualization
|
||||||
|
|
||||||
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(rd_collection_block_prod);
|
internal void rd_ev_view_rule_block_prod_collection_debug_tables(Arena *arena, RDI_SectionKind target, EV_View *view, String8 filter, EV_Key parent_key, EV_Key key, EV_ExpandNode *expand_node, String8 string, E_Expr *expr, EV_ViewRuleList *view_rules, MD_Node *view_params, S32 depth, struct EV_BlockList *out);
|
||||||
internal EV_View *rd_ev_view_from_key(U64 key);
|
internal EV_View *rd_ev_view_from_key(U64 key);
|
||||||
internal F32 rd_append_value_strings_from_eval(Arena *arena, EV_StringFlags flags, U32 default_radix, FNT_Tag font, F32 font_size, F32 max_size, S32 depth, E_Eval eval, E_Member *member, EV_ViewRuleList *view_rules, String8List *out);
|
internal F32 rd_append_value_strings_from_eval(Arena *arena, EV_StringFlags flags, U32 default_radix, FNT_Tag font, F32 font_size, F32 max_size, S32 depth, E_Eval eval, E_Member *member, EV_ViewRuleList *view_rules, String8List *out);
|
||||||
internal String8 rd_value_string_from_eval(Arena *arena, EV_StringFlags flags, U32 default_radix, FNT_Tag font, F32 font_size, F32 max_size, E_Eval eval, E_Member *member, EV_ViewRuleList *view_rules);
|
internal String8 rd_value_string_from_eval(Arena *arena, EV_StringFlags flags, U32 default_radix, FNT_Tag font, F32 font_size, F32 max_size, E_Eval eval, E_Member *member, EV_ViewRuleList *view_rules);
|
||||||
|
|||||||
@@ -849,9 +849,10 @@ rd_string_from_eval_viz_row_column(Arena *arena, EV_View *ev, EV_Row *row, RD_Wa
|
|||||||
case RD_WatchViewColumnKind_Module:
|
case RD_WatchViewColumnKind_Module:
|
||||||
{
|
{
|
||||||
E_Eval eval = e_eval_from_expr(arena, row->expr);
|
E_Eval eval = e_eval_from_expr(arena, row->expr);
|
||||||
|
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||||
CTRL_Entity *process = ctrl_entity_from_handle(d_state->ctrl_entity_store, rd_regs()->process);
|
CTRL_Entity *process = ctrl_entity_from_handle(d_state->ctrl_entity_store, rd_regs()->process);
|
||||||
CTRL_Entity *module = ctrl_module_from_process_vaddr(process, eval.value.u64);
|
CTRL_Entity *module = ctrl_module_from_process_vaddr(process, value_eval.value.u64);
|
||||||
result = push_str8_copy(arena, module->string);
|
result = str8_skip_last_slash(module->string);
|
||||||
}break;
|
}break;
|
||||||
case RD_WatchViewColumnKind_Member:
|
case RD_WatchViewColumnKind_Member:
|
||||||
{
|
{
|
||||||
@@ -2311,12 +2312,15 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
|
|||||||
////////////////////////
|
////////////////////////
|
||||||
//- rjf: canvas block row -> build singular row for "escape hatch" ui
|
//- rjf: canvas block row -> build singular row for "escape hatch" ui
|
||||||
//
|
//
|
||||||
if(row->block_kind == EV_BlockKind_Canvas)
|
B32 did_row_build = 0;
|
||||||
|
if(!did_row_build && row->block_kind == EV_BlockKind_Canvas)
|
||||||
UI_Parent(row_box) UI_FocusHot(row_selected ? UI_FocusKind_On : UI_FocusKind_Off)
|
UI_Parent(row_box) UI_FocusHot(row_selected ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||||
{
|
{
|
||||||
//- rjf: build ui hook row contents
|
//- rjf: build ui hook row contents
|
||||||
if(ui_view_rule_info != &rd_nil_view_rule_info && ui_view_rule_info->ui != 0)
|
if(ui_view_rule_info != &rd_nil_view_rule_info && ui_view_rule_info->ui != 0)
|
||||||
{
|
{
|
||||||
|
did_row_build = 1;
|
||||||
|
|
||||||
//- rjf: unpack
|
//- rjf: unpack
|
||||||
RD_WatchViewPoint pt = {0, row->parent_key, row->key};
|
RD_WatchViewPoint pt = {0, row->parent_key, row->key};
|
||||||
RD_View *view = rd_view_from_handle(rd_regs()->view);
|
RD_View *view = rd_view_from_handle(rd_regs()->view);
|
||||||
@@ -2412,10 +2416,53 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////
|
////////////////////////
|
||||||
//- rjf: build non-canvas row contents
|
//- rjf: build button row
|
||||||
//
|
//
|
||||||
if(row->block_kind != EV_BlockKind_Canvas) UI_Parent(row_box) UI_HeightFill
|
if(!did_row_build && row->depth == 0 && flags & RD_WatchViewFlag_RootButtons) UI_Parent(row_box) UI_HeightFill UI_FocusHot(row_selected ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||||
{
|
{
|
||||||
|
did_row_build = 1;
|
||||||
|
switch(row_eval.space.kind)
|
||||||
|
{
|
||||||
|
default:{did_row_build = 0;}break;
|
||||||
|
case RD_EvalSpaceKind_MetaEntity:
|
||||||
|
{
|
||||||
|
RD_Entity *entity = rd_entity_from_eval_space(row_eval.space);
|
||||||
|
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable|UI_BoxFlag_DrawHotEffects|UI_BoxFlag_DrawActiveEffects, "###entity_%p", entity);
|
||||||
|
UI_Parent(box)
|
||||||
|
{
|
||||||
|
if(row_is_expandable) UI_PrefWidth(ui_em(2.f, 1.f)) UI_Focus(UI_FocusKind_Off)
|
||||||
|
{
|
||||||
|
if(ui_pressed(ui_expanderf(next_row_expanded, "###expand_%p", entity)))
|
||||||
|
{
|
||||||
|
next_row_expanded ^= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DR_FancyStringList fstrs = rd_title_fstrs_from_entity(scratch.arena, entity, rd_rgba_from_theme_color(RD_ThemeColor_TextWeak), ui_top_font_size());
|
||||||
|
UI_Box *label = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero());
|
||||||
|
ui_box_equip_display_fancy_strings(label, &fstrs);
|
||||||
|
}
|
||||||
|
UI_Signal sig = ui_signal_from_box(box);
|
||||||
|
if(ui_pressed(sig))
|
||||||
|
{
|
||||||
|
RD_WatchViewPoint cell_pt = {0, row->parent_key, row->key};
|
||||||
|
ewv->next_cursor = ewv->next_mark = cell_pt;
|
||||||
|
pressed = 1;
|
||||||
|
}
|
||||||
|
}break;
|
||||||
|
case RD_EvalSpaceKind_MetaCtrlEntity:
|
||||||
|
{
|
||||||
|
|
||||||
|
}break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////
|
||||||
|
//- rjf: build regular row contents in all other cases
|
||||||
|
//
|
||||||
|
if(!did_row_build) UI_Parent(row_box) UI_HeightFill
|
||||||
|
{
|
||||||
|
did_row_build = 1;
|
||||||
|
|
||||||
//////////////////////
|
//////////////////////
|
||||||
//- rjf: draw start of cache lines in expansions
|
//- rjf: draw start of cache lines in expansions
|
||||||
//
|
//
|
||||||
@@ -2895,6 +2942,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////
|
//////////////////////
|
||||||
//- rjf: commit expansion state changes
|
//- rjf: commit expansion state changes
|
||||||
@@ -2907,7 +2955,6 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- rjf: general table-wide press logic
|
//- rjf: general table-wide press logic
|
||||||
@@ -5028,9 +5075,9 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(targets)
|
|||||||
{
|
{
|
||||||
rd_watch_view_init(wv);
|
rd_watch_view_init(wv);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.30f, .display_string = str8_lit("Expression"));
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.30f, .display_string = str8_lit("Expression"));
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.70f, .display_string = str8_lit("Value"), .dequote_string = 1, .is_non_code = 1);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.70f, .display_string = str8_lit("Value"));
|
||||||
}
|
}
|
||||||
rd_watch_view_build(wv, RD_WatchViewFlag_NoHeader, str8_lit("targets"), str8_lit("collection, only:label exe args working_directory entry_point str"), 0, 10, rect);
|
rd_watch_view_build(wv, RD_WatchViewFlag_NoHeader|RD_WatchViewFlag_RootButtons, str8_lit("targets"), str8_lit("collection, only:label exe args working_directory entry_point str"), 0, 10, rect);
|
||||||
ProfEnd();
|
ProfEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5799,7 +5846,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(call_stack)
|
|||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.7f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.7f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Module, 0.25f, .is_non_code = 1);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Module, 0.25f, .is_non_code = 1);
|
||||||
}
|
}
|
||||||
rd_watch_view_build(wv, 0, str8_lit("current_thread.callstack.v"), str8_lit("cast:void**, array:current_thread.callstack.count"), 0, 10, rect);
|
rd_watch_view_build(wv, 0, str8_lit("current_thread.callstack.v"), str8_lit("array:current_thread.callstack.count"), 0, 10, rect);
|
||||||
ProfEnd();
|
ProfEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ typedef U32 RD_WatchViewFlags;
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
RD_WatchViewFlag_NoHeader = (1<<0),
|
RD_WatchViewFlag_NoHeader = (1<<0),
|
||||||
|
RD_WatchViewFlag_RootButtons = (1<<1),
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum RD_WatchViewColumnKind
|
typedef enum RD_WatchViewColumnKind
|
||||||
|
|||||||
Reference in New Issue
Block a user