begin setting up view rules for scheduler tree

This commit is contained in:
Ryan Fleury
2024-10-11 16:01:40 -07:00
parent e86190a3d3
commit 7724c7f7d3
7 changed files with 216 additions and 18 deletions
+4 -1
View File
@@ -601,7 +601,10 @@ ctrl_entity_store_alloc(void)
}
CTRL_Entity *root = store->root = ctrl_entity_alloc(store, &ctrl_entity_nil, CTRL_EntityKind_Root, Arch_Null, ctrl_handle_zero(), 0);
CTRL_Entity *local_machine = ctrl_entity_alloc(store, root, CTRL_EntityKind_Machine, arch_from_context(), ctrl_handle_make(CTRL_MachineID_Local, dmn_handle_zero()), 0);
(void)local_machine;
Temp scratch = scratch_begin(0, 0);
String8 local_machine_name = push_str8f(scratch.arena, "This PC (%S)", os_get_system_info()->machine_name);
ctrl_entity_equip_string(store, local_machine, local_machine_name);
scratch_end(scratch);
return store;
}
+35 -7
View File
@@ -672,15 +672,19 @@ str8_lit_comp("5"),
str8_lit_comp("c"),
};
String8 rd_collection_name_table[13] =
String8 rd_collection_name_table[17] =
{
str8_lit_comp("watches"),
str8_lit_comp("targets"),
str8_lit_comp("breakpoints"),
str8_lit_comp("watch_pins"),
str8_lit_comp("file_path_maps"),
str8_lit_comp("machines"),
str8_lit_comp("processes"),
str8_lit_comp("threads"),
str8_lit_comp("modules"),
str8_lit_comp("machine"),
str8_lit_comp("process"),
str8_lit_comp("locals"),
str8_lit_comp("registers"),
str8_lit_comp("globals"),
@@ -689,7 +693,7 @@ str8_lit_comp("types"),
str8_lit_comp("procedures"),
};
RD_EntityKind rd_collection_entity_kind_table[13] =
RD_EntityKind rd_collection_entity_kind_table[17] =
{
RD_EntityKind_Watch,
RD_EntityKind_Target,
@@ -704,15 +708,21 @@ RD_EntityKind_Nil,
RD_EntityKind_Nil,
RD_EntityKind_Nil,
RD_EntityKind_Nil,
RD_EntityKind_Nil,
RD_EntityKind_Nil,
RD_EntityKind_Nil,
RD_EntityKind_Nil,
};
CTRL_EntityKind rd_collection_ctrl_entity_kind_table[13] =
CTRL_EntityKind rd_collection_ctrl_entity_kind_table[17] =
{
CTRL_EntityKind_Null,
CTRL_EntityKind_Null,
CTRL_EntityKind_Null,
CTRL_EntityKind_Null,
CTRL_EntityKind_Null,
CTRL_EntityKind_Machine,
CTRL_EntityKind_Process,
CTRL_EntityKind_Thread,
CTRL_EntityKind_Module,
CTRL_EntityKind_Null,
@@ -721,17 +731,23 @@ CTRL_EntityKind_Null,
CTRL_EntityKind_Null,
CTRL_EntityKind_Null,
CTRL_EntityKind_Null,
CTRL_EntityKind_Null,
CTRL_EntityKind_Null,
};
EV_ViewRuleExprExpandInfoHookFunctionType * rd_collection_expr_expand_info_hook_function_table[13] =
EV_ViewRuleExprExpandInfoHookFunctionType * rd_collection_expr_expand_info_hook_function_table[17] =
{
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(watches),
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(targets),
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(breakpoints),
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(watch_pins),
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(file_path_maps),
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(machines),
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(processes),
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(threads),
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(modules),
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(machine),
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(process),
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(locals),
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(registers),
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(globals),
@@ -740,15 +756,19 @@ EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(types),
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(procedures),
};
EV_ViewRuleExprExpandRangeInfoHookFunctionType * rd_collection_expr_expand_range_info_hook_function_table[13] =
EV_ViewRuleExprExpandRangeInfoHookFunctionType * rd_collection_expr_expand_range_info_hook_function_table[17] =
{
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(watches),
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(targets),
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(breakpoints),
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(watch_pins),
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(file_path_maps),
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(machines),
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(processes),
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(threads),
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(modules),
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(machine),
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(process),
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(locals),
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(registers),
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(globals),
@@ -757,15 +777,19 @@ EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(types),
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_NAME(procedures),
};
EV_ViewRuleExprExpandIDFromNumHookFunctionType * rd_collection_expr_expand_id_from_num_hook_function_table[13] =
EV_ViewRuleExprExpandIDFromNumHookFunctionType * rd_collection_expr_expand_id_from_num_hook_function_table[17] =
{
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(watches),
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(targets),
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(breakpoints),
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(watch_pins),
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(file_path_maps),
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(machines),
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(processes),
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(threads),
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(modules),
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(machine),
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(process),
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(identity),
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(identity),
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(globals),
@@ -774,15 +798,19 @@ EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(types),
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_NAME(procedures),
};
EV_ViewRuleExprExpandIDFromNumHookFunctionType * rd_collection_expr_expand_num_from_id_hook_function_table[13] =
EV_ViewRuleExprExpandIDFromNumHookFunctionType * rd_collection_expr_expand_num_from_id_hook_function_table[17] =
{
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(watches),
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(targets),
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(breakpoints),
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(watch_pins),
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(file_path_maps),
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(machines),
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(processes),
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(threads),
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(modules),
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(machine),
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(process),
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(identity),
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(identity),
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(globals),
+23 -7
View File
@@ -653,8 +653,12 @@ EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(targets);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(breakpoints);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(watch_pins);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(file_path_maps);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(machines);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(processes);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(threads);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(modules);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(machine);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(process);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(locals);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(registers);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(globals);
@@ -666,8 +670,12 @@ EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(targets);
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(breakpoints);
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(watch_pins);
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(file_path_maps);
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(machines);
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(processes);
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(threads);
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(modules);
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(machine);
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(process);
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(locals);
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(registers);
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(globals);
@@ -679,8 +687,12 @@ EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(targets);
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(breakpoints);
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(watch_pins);
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(file_path_maps);
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(machines);
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(processes);
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(threads);
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(modules);
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(machine);
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(process);
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(globals);
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(thread_locals);
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(types);
@@ -690,8 +702,12 @@ EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(targets);
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(breakpoints);
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(watch_pins);
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(file_path_maps);
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(machines);
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(processes);
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(threads);
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(modules);
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(machine);
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(process);
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(globals);
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(thread_locals);
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(types);
@@ -751,13 +767,13 @@ extern RD_StringBindingPair rd_default_binding_table[110];
extern String8 rd_binding_version_remap_old_name_table[7];
extern String8 rd_binding_version_remap_new_name_table[7];
extern String8 rd_icon_kind_text_table[69];
extern String8 rd_collection_name_table[13];
extern RD_EntityKind rd_collection_entity_kind_table[13];
extern CTRL_EntityKind rd_collection_ctrl_entity_kind_table[13];
extern EV_ViewRuleExprExpandInfoHookFunctionType * rd_collection_expr_expand_info_hook_function_table[13];
extern EV_ViewRuleExprExpandRangeInfoHookFunctionType * rd_collection_expr_expand_range_info_hook_function_table[13];
extern EV_ViewRuleExprExpandIDFromNumHookFunctionType * rd_collection_expr_expand_id_from_num_hook_function_table[13];
extern EV_ViewRuleExprExpandIDFromNumHookFunctionType * rd_collection_expr_expand_num_from_id_hook_function_table[13];
extern String8 rd_collection_name_table[17];
extern RD_EntityKind rd_collection_entity_kind_table[17];
extern CTRL_EntityKind rd_collection_ctrl_entity_kind_table[17];
extern EV_ViewRuleExprExpandInfoHookFunctionType * rd_collection_expr_expand_info_hook_function_table[17];
extern EV_ViewRuleExprExpandRangeInfoHookFunctionType * rd_collection_expr_expand_range_info_hook_function_table[17];
extern EV_ViewRuleExprExpandIDFromNumHookFunctionType * rd_collection_expr_expand_id_from_num_hook_function_table[17];
extern EV_ViewRuleExprExpandIDFromNumHookFunctionType * rd_collection_expr_expand_num_from_id_hook_function_table[17];
extern RD_ViewRuleInfo rd_view_rule_kind_info_table[34];
extern RD_IconKind rd_entity_kind_icon_kind_table[30];
extern String8 rd_theme_preset_display_string_table[9];
+11
View File
@@ -823,13 +823,24 @@ RD_IconTable:
@table(name entity_kind ctrl_entity_kind id_space)
RD_CollectionTable:
{
//- rjf: frontend entity groups
{watches Watch Null x}
{targets Target Null x}
{breakpoints Breakpoint Null x}
{watch_pins WatchPin Null x}
{file_path_maps FilePathMap Null x}
//- rjf: control entity groups
{machines Nil Machine x}
{processes Nil Process x}
{threads Nil Thread x}
{modules Nil Module x}
//- rjf: control entity hierarchies
{machine Nil Null x}
{process Nil Null x}
//- rjf: debug info / architecture watch tables
{locals Nil Null -}
{registers Nil Null -}
{globals Nil Null x}
+141 -1
View File
@@ -8514,8 +8514,16 @@ EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(file_path_maps) { return rd_ev
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(file_path_maps) { return rd_ev_view_rule_expr_id_from_num__meta_entities(num, user_data, RD_EntityKind_FilePathMap, 1); }
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(file_path_maps) { return rd_ev_view_rule_expr_num_from_id__meta_entities(id, user_data, RD_EntityKind_FilePathMap, 1); }
//- rjf: meta ctrl entities
//- rjf: control entity groups
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(machines) { return rd_ev_view_rule_expr_expand_info__meta_ctrl_entities(arena, view, filter, expr, params, CTRL_EntityKind_Machine); }
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(machines) { return rd_ev_view_rule_expr_expand_range_info__meta_ctrl_entities(arena, view, filter, expr, params, idx_range, user_data, CTRL_EntityKind_Machine); }
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(machines) { return rd_ev_view_rule_expr_id_from_num__meta_ctrl_entities(num, user_data, CTRL_EntityKind_Machine); }
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(machines) { return rd_ev_view_rule_expr_num_from_id__meta_ctrl_entities(id, user_data, CTRL_EntityKind_Machine); }
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(processes) { return rd_ev_view_rule_expr_expand_info__meta_ctrl_entities(arena, view, filter, expr, params, CTRL_EntityKind_Process); }
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(processes) { return rd_ev_view_rule_expr_expand_range_info__meta_ctrl_entities(arena, view, filter, expr, params, idx_range, user_data, CTRL_EntityKind_Process); }
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(processes) { return rd_ev_view_rule_expr_id_from_num__meta_ctrl_entities(num, user_data, CTRL_EntityKind_Process); }
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(processes) { return rd_ev_view_rule_expr_num_from_id__meta_ctrl_entities(id, user_data, CTRL_EntityKind_Process); }
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(threads) { return rd_ev_view_rule_expr_expand_info__meta_ctrl_entities(arena, view, filter, expr, params, CTRL_EntityKind_Thread); }
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(threads) { return rd_ev_view_rule_expr_expand_range_info__meta_ctrl_entities(arena, view, filter, expr, params, idx_range, user_data, CTRL_EntityKind_Thread); }
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(threads) { return rd_ev_view_rule_expr_id_from_num__meta_ctrl_entities(num, user_data, CTRL_EntityKind_Thread); }
@@ -8525,6 +8533,136 @@ EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(modules) { return rd_ev_vie
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(modules) { return rd_ev_view_rule_expr_id_from_num__meta_ctrl_entities(num, user_data, CTRL_EntityKind_Module); }
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(modules) { return rd_ev_view_rule_expr_num_from_id__meta_ctrl_entities(id, user_data, CTRL_EntityKind_Module); }
//- rjf: control entity hierarchies
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(machine)
{
EV_ExpandInfo info = {0};
Temp scratch = scratch_begin(&arena, 1);
E_Eval eval = e_eval_from_expr(scratch.arena, expr);
CTRL_Entity *machine = rd_ctrl_entity_from_eval_space(eval.space);
if(machine->kind == CTRL_EntityKind_Machine)
{
CTRL_EntityList processes = {0};
for(CTRL_Entity *child = machine->first; child != &ctrl_entity_nil; child = child->next)
{
if(child->kind == CTRL_EntityKind_Process)
{
ctrl_entity_list_push(scratch.arena, &processes, child);
}
}
CTRL_EntityArray *processes_array = push_array(arena, CTRL_EntityArray, 1);
*processes_array = ctrl_entity_array_from_list(arena, &processes);
info.user_data = processes_array;
info.row_count = processes.count;
}
scratch_end(scratch);
return info;
}
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(machine)
{
EV_ExpandRangeInfo info = {0};
{
CTRL_EntityArray *processes = (CTRL_EntityArray *)user_data;
if(processes != 0)
{
info.row_exprs_count = dim_1u64(idx_range);
info.row_strings = push_array(arena, String8, info.row_exprs_count);
info.row_view_rules = push_array(arena, String8, info.row_exprs_count);
info.row_exprs = push_array(arena, E_Expr *, info.row_exprs_count);
info.row_members = push_array(arena, E_Member *, info.row_exprs_count);
U64 row_expr_idx = 0;
for(U64 idx = idx_range.min; idx < idx_range.max; idx += 1, row_expr_idx += 1)
{
CTRL_Entity *process = processes->v[idx];
E_Expr *expr = e_push_expr(arena, E_ExprKind_LeafOffset, 0);
expr->space = rd_eval_space_from_ctrl_entity(process, RD_EvalSpaceKind_MetaCtrlEntity);
expr->mode = E_Mode_Offset;
expr->type_key = e_type_key_cons_base(type(CTRL_ProcessMetaEval));;
info.row_strings[idx] = process->string;
info.row_exprs[idx] = expr;
info.row_members[idx] = &e_member_nil;
}
}
}
return info;
}
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(machine)
{
return num;
}
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(machine)
{
return id;
}
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(process)
{
EV_ExpandInfo info = {0};
Temp scratch = scratch_begin(&arena, 1);
E_Eval eval = e_eval_from_expr(scratch.arena, expr);
CTRL_Entity *process = rd_ctrl_entity_from_eval_space(eval.space);
if(process->kind == CTRL_EntityKind_Process)
{
CTRL_EntityList threads = {0};
for(CTRL_Entity *child = process->first; child != &ctrl_entity_nil; child = child->next)
{
if(child->kind == CTRL_EntityKind_Thread)
{
ctrl_entity_list_push(scratch.arena, &threads, child);
}
}
CTRL_EntityArray *threads_array = push_array(arena, CTRL_EntityArray, 1);
*threads_array = ctrl_entity_array_from_list(arena, &threads);
info.user_data = threads_array;
info.row_count = threads.count;
}
scratch_end(scratch);
return info;
}
EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(process)
{
EV_ExpandRangeInfo info = {0};
{
CTRL_EntityArray *threads = (CTRL_EntityArray *)user_data;
if(threads != 0)
{
info.row_exprs_count = dim_1u64(idx_range);
info.row_strings = push_array(arena, String8, info.row_exprs_count);
info.row_view_rules = push_array(arena, String8, info.row_exprs_count);
info.row_exprs = push_array(arena, E_Expr *, info.row_exprs_count);
info.row_members = push_array(arena, E_Member *, info.row_exprs_count);
U64 row_expr_idx = 0;
for(U64 idx = idx_range.min; idx < idx_range.max; idx += 1, row_expr_idx += 1)
{
CTRL_Entity *thread = threads->v[idx];
E_Expr *expr = e_push_expr(arena, E_ExprKind_LeafOffset, 0);
expr->space = rd_eval_space_from_ctrl_entity(thread, RD_EvalSpaceKind_MetaCtrlEntity);
expr->mode = E_Mode_Offset;
expr->type_key = e_type_key_cons_base(type(CTRL_ThreadMetaEval));;
info.row_strings[idx] = thread->string;
info.row_exprs[idx] = expr;
info.row_members[idx] = &e_member_nil;
}
}
}
return info;
}
EV_VIEW_RULE_EXPR_EXPAND_ID_FROM_NUM_FUNCTION_DEF(process)
{
return num;
}
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(process)
{
return id;
}
//- rjf: locals
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(locals)
@@ -11724,6 +11862,8 @@ rd_frame(void)
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"), 1);
ev_auto_view_rule_table_push_new(scratch.arena, auto_view_rule_table, e_type_key_cons_base(type(CTRL_MachineMetaEval)), str8_lit("machine"), 1);
ev_auto_view_rule_table_push_new(scratch.arena, auto_view_rule_table, e_type_key_cons_base(type(CTRL_ProcessMetaEval)), str8_lit("process"), 1);
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], 1);
+1 -1
View File
@@ -2234,7 +2234,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
case E_Mode_Offset:
{
CTRL_Entity *space_entity = rd_ctrl_entity_from_eval_space(row_eval.space);
if(space_entity->kind == CTRL_EntityKind_Process)
if(row_eval.space.kind == RD_EvalSpaceKind_CtrlEntity && space_entity->kind == CTRL_EntityKind_Process)
{
U64 size = e_type_byte_size_from_key(row_eval.type_key);
size = Min(size, 64);
+1 -1
View File
@@ -318,7 +318,7 @@ rd_cmd_spec_button(String8 name)
ui_set_next_flags(UI_BoxFlag_Clickable);
ui_set_next_group_key(ui_key_zero());
UI_PrefWidth(ui_children_sum(1))
UI_Column UI_Padding(ui_em(0.5f, 1.f)) UI_FontSize(ui_top_font_size()*0.95f) UI_HeightFill
UI_FontSize(ui_top_font_size()*0.95f) UI_HeightFill
UI_NamedRow(str8_lit("###bindings"))
UI_FlagsAdd(UI_BoxFlag_DrawTextWeak)
UI_FastpathCodepoint(0)