mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-26 21:44:59 -07:00
eliminate old per-frame cfg group cache
This commit is contained in:
@@ -150,8 +150,8 @@ typedef EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_SIG(EV_ViewRuleExprExpandN
|
||||
typedef U32 EV_ViewRuleInfoFlags; // NOTE(rjf): see @view_rule_info
|
||||
enum
|
||||
{
|
||||
EV_ViewRuleInfoFlag_Inherited = (1<<0),
|
||||
EV_ViewRuleInfoFlag_Expandable = (1<<1),
|
||||
EV_ViewRuleInfoFlag_Inherited = (1<<0),
|
||||
EV_ViewRuleInfoFlag_Expandable = (1<<1),
|
||||
};
|
||||
|
||||
typedef struct EV_ViewRuleInfo EV_ViewRuleInfo;
|
||||
|
||||
@@ -13181,18 +13181,6 @@ rd_frame(void)
|
||||
str8_lit("auto_view_rule"),
|
||||
};
|
||||
|
||||
//- rjf: store off eval collections for this frame
|
||||
rd_state->eval_collection_cfg_names = push_array(rd_frame_arena(), String8Array, 1);
|
||||
rd_state->eval_collection_cfg_names->count = ArrayCount(evallable_cfg_names);
|
||||
rd_state->eval_collection_cfg_names->v = push_array(rd_frame_arena(), String8, rd_state->eval_collection_cfg_names->count);
|
||||
MemoryCopy(rd_state->eval_collection_cfg_names->v, evallable_cfg_names, sizeof(evallable_cfg_names));
|
||||
rd_state->eval_collection_cfgs = push_array(rd_frame_arena(), RD_CfgArray, rd_state->eval_collection_cfg_names->count);
|
||||
for EachElement(idx, evallable_cfg_names)
|
||||
{
|
||||
RD_CfgList list = rd_cfg_top_level_list_from_string(scratch.arena, evallable_cfg_names[idx]);
|
||||
rd_state->eval_collection_cfgs[idx] = rd_cfg_array_from_list(rd_frame_arena(), &list);
|
||||
}
|
||||
|
||||
//- rjf: build special member types for evallable config types
|
||||
E_TypeKey bool_type_key = {0};
|
||||
E_TypeKey u64_type_key = {0};
|
||||
@@ -13278,10 +13266,10 @@ rd_frame(void)
|
||||
for EachElement(idx, evallable_cfg_names)
|
||||
{
|
||||
String8 name = evallable_cfg_names[idx];
|
||||
RD_CfgArray cfgs = rd_state->eval_collection_cfgs[idx];
|
||||
for EachIndex(cfg_idx, cfgs.count)
|
||||
RD_CfgList cfgs = rd_cfg_top_level_list_from_string(scratch.arena, name);
|
||||
for(RD_CfgNode *n = cfgs.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Cfg *cfg = cfgs.v[cfg_idx];
|
||||
RD_Cfg *cfg = n->v;
|
||||
String8 label = rd_cfg_child_from_string(cfg, str8_lit("label"))->first->string;
|
||||
String8 exe = rd_cfg_child_from_string(cfg, str8_lit("executable"))->first->string;
|
||||
E_Space space = rd_eval_space_from_cfg(cfg);
|
||||
@@ -13858,7 +13846,7 @@ rd_frame(void)
|
||||
RD_Cfg *user = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("user"));
|
||||
RD_Cfg *watch = rd_cfg_new(user, str8_lit("watch"));
|
||||
RD_Cfg *expr = rd_cfg_new(watch, str8_lit("expression"));
|
||||
rd_cfg_new(expr, str8_lit("basics"));
|
||||
rd_cfg_new(expr, str8_lit("targets[0]"));
|
||||
}
|
||||
}break;
|
||||
|
||||
|
||||
@@ -870,10 +870,6 @@ struct RD_State
|
||||
// rjf: config -> eval blob map (lazily constructed from-scratch each frame)
|
||||
RD_Cfg2EvalBlobMap *cfg2evalblob_map;
|
||||
|
||||
// rjf: eval collections (constructed from scratch every frame)
|
||||
String8Array *eval_collection_cfg_names;
|
||||
RD_CfgArray *eval_collection_cfgs;
|
||||
|
||||
// rjf: registers stack
|
||||
RD_RegsNode base_regs;
|
||||
RD_RegsNode *top_regs;
|
||||
|
||||
@@ -952,8 +952,25 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: determine cfg group
|
||||
// rjf: determine cfg group name
|
||||
{
|
||||
E_IRTreeAndType block_irtree = e_irtree_and_type_from_expr(scratch.arena, row->block->expr);
|
||||
E_TypeKey block_type_key = block_irtree.type_key;
|
||||
E_TypeKind block_type_kind = e_type_kind_from_key(block_type_key);
|
||||
if(block_type_kind == E_TypeKind_Set)
|
||||
{
|
||||
E_Type *block_type = e_type_from_key(scratch.arena, block_type_key);
|
||||
info.group_cfg_name = rd_singular_from_code_name_plural(block_type->name);
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: determine row's cfg
|
||||
if(info.group_cfg_name.size != 0)
|
||||
{
|
||||
RD_CfgList cfgs = rd_cfg_top_level_list_from_string(scratch.arena, info.group_cfg_name);
|
||||
// TODO(rjf): this is not correct - assumes row's evaluation is in the block's space...
|
||||
// info.group_cfg = rd_cfg_from_eval_space(info.eval.space);
|
||||
}
|
||||
|
||||
// rjf: fill row's cells
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .string = str8_lit("expression"), .pct = 0.25f);
|
||||
|
||||
@@ -71,7 +71,7 @@ struct RD_WatchRowInfo
|
||||
{
|
||||
E_Eval eval;
|
||||
CTRL_Entity *module;
|
||||
String8 group_key;
|
||||
String8 group_cfg_name;
|
||||
RD_Cfg *group_cfg;
|
||||
CTRL_Entity *group_entity;
|
||||
CTRL_Entity *callstack_thread;
|
||||
|
||||
Reference in New Issue
Block a user