Skip to content

Commit b1829af

Browse files
committed
eliminate old per-frame cfg group cache
1 parent 5b82fc2 commit b1829af

File tree

5 files changed

+25
-24
lines changed

5 files changed

+25
-24
lines changed

src/eval_visualization/eval_visualization_core.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ typedef EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_SIG(EV_ViewRuleExprExpandN
150150
typedef U32 EV_ViewRuleInfoFlags; // NOTE(rjf): see @view_rule_info
151151
enum
152152
{
153-
EV_ViewRuleInfoFlag_Inherited = (1<<0),
154-
EV_ViewRuleInfoFlag_Expandable = (1<<1),
153+
EV_ViewRuleInfoFlag_Inherited = (1<<0),
154+
EV_ViewRuleInfoFlag_Expandable = (1<<1),
155155
};
156156

157157
typedef struct EV_ViewRuleInfo EV_ViewRuleInfo;

src/raddbg/raddbg_core.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13181,18 +13181,6 @@ rd_frame(void)
1318113181
str8_lit("auto_view_rule"),
1318213182
};
1318313183

13184-
//- rjf: store off eval collections for this frame
13185-
rd_state->eval_collection_cfg_names = push_array(rd_frame_arena(), String8Array, 1);
13186-
rd_state->eval_collection_cfg_names->count = ArrayCount(evallable_cfg_names);
13187-
rd_state->eval_collection_cfg_names->v = push_array(rd_frame_arena(), String8, rd_state->eval_collection_cfg_names->count);
13188-
MemoryCopy(rd_state->eval_collection_cfg_names->v, evallable_cfg_names, sizeof(evallable_cfg_names));
13189-
rd_state->eval_collection_cfgs = push_array(rd_frame_arena(), RD_CfgArray, rd_state->eval_collection_cfg_names->count);
13190-
for EachElement(idx, evallable_cfg_names)
13191-
{
13192-
RD_CfgList list = rd_cfg_top_level_list_from_string(scratch.arena, evallable_cfg_names[idx]);
13193-
rd_state->eval_collection_cfgs[idx] = rd_cfg_array_from_list(rd_frame_arena(), &list);
13194-
}
13195-
1319613184
//- rjf: build special member types for evallable config types
1319713185
E_TypeKey bool_type_key = {0};
1319813186
E_TypeKey u64_type_key = {0};
@@ -13278,10 +13266,10 @@ rd_frame(void)
1327813266
for EachElement(idx, evallable_cfg_names)
1327913267
{
1328013268
String8 name = evallable_cfg_names[idx];
13281-
RD_CfgArray cfgs = rd_state->eval_collection_cfgs[idx];
13282-
for EachIndex(cfg_idx, cfgs.count)
13269+
RD_CfgList cfgs = rd_cfg_top_level_list_from_string(scratch.arena, name);
13270+
for(RD_CfgNode *n = cfgs.first; n != 0; n = n->next)
1328313271
{
13284-
RD_Cfg *cfg = cfgs.v[cfg_idx];
13272+
RD_Cfg *cfg = n->v;
1328513273
String8 label = rd_cfg_child_from_string(cfg, str8_lit("label"))->first->string;
1328613274
String8 exe = rd_cfg_child_from_string(cfg, str8_lit("executable"))->first->string;
1328713275
E_Space space = rd_eval_space_from_cfg(cfg);
@@ -13858,7 +13846,7 @@ rd_frame(void)
1385813846
RD_Cfg *user = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("user"));
1385913847
RD_Cfg *watch = rd_cfg_new(user, str8_lit("watch"));
1386013848
RD_Cfg *expr = rd_cfg_new(watch, str8_lit("expression"));
13861-
rd_cfg_new(expr, str8_lit("basics"));
13849+
rd_cfg_new(expr, str8_lit("targets[0]"));
1386213850
}
1386313851
}break;
1386413852

src/raddbg/raddbg_core.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -870,10 +870,6 @@ struct RD_State
870870
// rjf: config -> eval blob map (lazily constructed from-scratch each frame)
871871
RD_Cfg2EvalBlobMap *cfg2evalblob_map;
872872

873-
// rjf: eval collections (constructed from scratch every frame)
874-
String8Array *eval_collection_cfg_names;
875-
RD_CfgArray *eval_collection_cfgs;
876-
877873
// rjf: registers stack
878874
RD_RegsNode base_regs;
879875
RD_RegsNode *top_regs;

src/raddbg/raddbg_views.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,8 +952,25 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
952952
}
953953
}
954954

955-
// rjf: determine cfg group
955+
// rjf: determine cfg group name
956+
{
957+
E_IRTreeAndType block_irtree = e_irtree_and_type_from_expr(scratch.arena, row->block->expr);
958+
E_TypeKey block_type_key = block_irtree.type_key;
959+
E_TypeKind block_type_kind = e_type_kind_from_key(block_type_key);
960+
if(block_type_kind == E_TypeKind_Set)
961+
{
962+
E_Type *block_type = e_type_from_key(scratch.arena, block_type_key);
963+
info.group_cfg_name = rd_singular_from_code_name_plural(block_type->name);
964+
}
965+
}
956966

967+
// rjf: determine row's cfg
968+
if(info.group_cfg_name.size != 0)
969+
{
970+
RD_CfgList cfgs = rd_cfg_top_level_list_from_string(scratch.arena, info.group_cfg_name);
971+
// TODO(rjf): this is not correct - assumes row's evaluation is in the block's space...
972+
// info.group_cfg = rd_cfg_from_eval_space(info.eval.space);
973+
}
957974

958975
// rjf: fill row's cells
959976
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .string = str8_lit("expression"), .pct = 0.25f);

src/raddbg/raddbg_views.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ struct RD_WatchRowInfo
7171
{
7272
E_Eval eval;
7373
CTRL_Entity *module;
74-
String8 group_key;
74+
String8 group_cfg_name;
7575
RD_Cfg *group_cfg;
7676
CTRL_Entity *group_entity;
7777
CTRL_Entity *callstack_thread;

0 commit comments

Comments
 (0)