shift watch view expressions from being a watch view implementation detail to being a top-level entity

This commit is contained in:
Ryan Fleury
2024-08-06 08:39:52 -07:00
parent 784a77bdff
commit 26f75fe7c1
9 changed files with 474 additions and 624 deletions
+124 -11
View File
@@ -1391,6 +1391,23 @@ df_rgba_from_entity(DF_Entity *entity)
return result;
}
//- rjf: entity -> expansion tree keys
internal DF_ExpandKey
df_expand_key_from_entity(DF_Entity *entity)
{
DF_ExpandKey parent_key = df_parent_expand_key_from_entity(entity);
DF_ExpandKey key = df_expand_key_make(df_hash_from_expand_key(parent_key), (U64)entity);
return key;
}
internal DF_ExpandKey
df_parent_expand_key_from_entity(DF_Entity *entity)
{
DF_ExpandKey parent_key = df_expand_key_make(5381, (U64)entity);
return parent_key;
}
////////////////////////////////
//~ rjf: Name Allocation
@@ -1688,9 +1705,10 @@ df_entity_release(DF_StateDeltaHistory *hist, DF_Entity *entity)
}
internal void
df_entity_change_parent(DF_StateDeltaHistory *hist, DF_Entity *entity, DF_Entity *old_parent, DF_Entity *new_parent)
df_entity_change_parent(DF_StateDeltaHistory *hist, DF_Entity *entity, DF_Entity *old_parent, DF_Entity *new_parent, DF_Entity *prev_child)
{
Assert(entity->parent == old_parent);
Assert(prev_child->parent == old_parent || df_entity_is_nil(prev_child));
// rjf: push delta records
if(hist != 0)
@@ -1725,7 +1743,7 @@ df_entity_change_parent(DF_StateDeltaHistory *hist, DF_Entity *entity, DF_Entity
}
if(!df_entity_is_nil(new_parent))
{
DLLPushBack_NPZ(&df_g_nil_entity, new_parent->first, new_parent->last, entity, next, prev);
DLLInsert_NPZ(&df_g_nil_entity, new_parent->first, new_parent->last, prev_child, entity, next, prev);
}
entity->parent = new_parent;
@@ -1733,6 +1751,8 @@ df_entity_change_parent(DF_StateDeltaHistory *hist, DF_Entity *entity, DF_Entity
df_entity_notify_mutation(entity);
df_entity_notify_mutation(new_parent);
df_entity_notify_mutation(old_parent);
df_entity_notify_mutation(prev_child);
df_state->kind_alloc_gens[entity->kind] += 1;
}
//- rjf: entity simple equipment
@@ -4495,7 +4515,7 @@ df_eval_viz_block_end(DF_EvalVizBlockList *list, DF_EvalVizBlock *block)
}
internal void
df_append_viz_blocks_for_parent__rec(Arena *arena, DI_Scope *scope, DF_EvalView *eval_view, DF_ExpandKey parent_key, DF_ExpandKey key, String8 string, E_Eval eval, E_Member *opt_member, DF_CfgTable *cfg_table, S32 depth, DF_EvalVizBlockList *list_out)
df_append_viz_blocks_for_parent__rec(Arena *arena, DF_EvalView *eval_view, DF_ExpandKey parent_key, DF_ExpandKey key, String8 string, E_Eval eval, E_Member *opt_member, DF_CfgTable *cfg_table, S32 depth, DF_EvalVizBlockList *list_out)
{
ProfBeginFunction();
Temp scratch = scratch_begin(&arena, 1);
@@ -4704,7 +4724,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DI_Scope *scope, DF_EvalView
child_eval.mode = udt_eval.mode;
child_eval.value.u64 = udt_eval.value.u64 + member->off;
}
df_append_viz_blocks_for_parent__rec(arena, scope, eval_view, key, child->key, member->name, child_eval, member, &child_cfg, depth+1, list_out);
df_append_viz_blocks_for_parent__rec(arena, eval_view, key, child->key, member->name, child_eval, member, &child_cfg, depth+1, list_out);
}
}
df_eval_viz_block_end(list_out, last_vb);
@@ -4822,7 +4842,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DI_Scope *scope, DF_EvalView
child_eval.mode = link_base.mode;
child_eval.value.u64= link_base.offset;
}
df_append_viz_blocks_for_parent__rec(arena, scope, eval_view, key, child->key, push_str8f(arena, "[%I64u]", child_idx), child_eval, 0, &child_cfg, depth+1, list_out);
df_append_viz_blocks_for_parent__rec(arena, eval_view, key, child->key, push_str8f(arena, "[%I64u]", child_idx), child_eval, 0, &child_cfg, depth+1, list_out);
}
}
df_eval_viz_block_end(list_out, last_vb);
@@ -4880,7 +4900,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DI_Scope *scope, DF_EvalView
child_eval.mode = arr_eval.mode;
child_eval.value.u64= arr_eval.value.u64 + child_idx*element_type_byte_size;
}
df_append_viz_blocks_for_parent__rec(arena, scope, eval_view, key, child->key, push_str8f(arena, "[%I64u]", child_idx), child_eval, 0, &child_cfg, depth+1, list_out);
df_append_viz_blocks_for_parent__rec(arena, eval_view, key, child->key, push_str8f(arena, "[%I64u]", child_idx), child_eval, 0, &child_cfg, depth+1, list_out);
}
}
df_eval_viz_block_end(list_out, last_vb);
@@ -4893,7 +4913,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DI_Scope *scope, DF_EvalView
ProfScope("build viz blocks for ptr-to-ptrs")
{
String8 subexpr = push_str8f(arena, "*(%S)", string);
df_append_viz_blocks_for_parent__rec(arena, scope, eval_view, key, df_expand_key_make(df_hash_from_expand_key(key), 1), subexpr, ptr_eval, 0, cfg_table, depth+1, list_out);
df_append_viz_blocks_for_parent__rec(arena, eval_view, key, df_expand_key_make(df_hash_from_expand_key(key), 1), subexpr, ptr_eval, 0, cfg_table, depth+1, list_out);
}
scratch_end(scratch);
@@ -4901,7 +4921,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DI_Scope *scope, DF_EvalView
}
internal DF_EvalVizBlockList
df_eval_viz_block_list_from_eval_view_expr_keys(Arena *arena, DI_Scope *scope, DF_EvalView *eval_view, String8 expr, DF_ExpandKey parent_key, DF_ExpandKey key)
df_eval_viz_block_list_from_eval_view_expr_keys(Arena *arena, DF_EvalView *eval_view, String8 expr, DF_ExpandKey parent_key, DF_ExpandKey key)
{
ProfBeginFunction();
DF_EvalVizBlockList blocks = {0};
@@ -4946,7 +4966,7 @@ df_eval_viz_block_list_from_eval_view_expr_keys(Arena *arena, DI_Scope *scope, D
df_cfg_table_push_unparsed_string(arena, &view_rule_table, n->string, DF_CfgSrc_User);
}
df_cfg_table_push_unparsed_string(arena, &view_rule_table, view_rule_string, DF_CfgSrc_User);
df_append_viz_blocks_for_parent__rec(arena, scope, eval_view, parent_key, key, expr, eval, 0, &view_rule_table, 0, &blocks);
df_append_viz_blocks_for_parent__rec(arena, eval_view, parent_key, key, expr, eval, 0, &view_rule_table, 0, &blocks);
}
ProfEnd();
return blocks;
@@ -5526,6 +5546,43 @@ df_cfg_strings_from_core(Arena *arena, String8 root_path, DF_CfgSrc source)
}
}
//- rjf: write watches
{
B32 first = 1;
DF_EntityList watches = df_query_cached_entity_list_with_kind(DF_EntityKind_Watch);
for(DF_EntityNode *n = watches.first; n != 0; n = n->next)
{
DF_Entity *watch = n->entity;
if(watch->cfg_src == source)
{
if(first)
{
first = 0;
str8_list_push(arena, &strs, str8_lit("/// watches ///////////////////////////////////////////////////////////////////\n"));
str8_list_push(arena, &strs, str8_lit("\n"));
}
Temp scratch = scratch_begin(&arena, 1);
DF_Entity *view_rule_entity = df_entity_child_from_kind(watch, DF_EntityKind_ViewRule);
String8 expr = watch->name;
String8 view_rule = view_rule_entity->name;
String8 expr_escaped = df_cfg_escaped_from_raw_string(arena, expr);
String8 view_rule_escaped = df_cfg_escaped_from_raw_string(arena, view_rule);
str8_list_push (arena, &strs, str8_lit("watch:\n"));
str8_list_push (arena, &strs, str8_lit("{\n"));
str8_list_pushf(arena, &strs, " expression: \"%S\"\n", expr_escaped);
str8_list_pushf(arena, &strs, " view_rule: \"%S\"\n", view_rule_escaped);
if(watch->flags & DF_EntityFlag_HasColor)
{
Vec4F32 hsva = df_hsva_from_entity(watch);
str8_list_pushf(arena, &strs, " hsva: %.2f %.2f %.2f %.2f\n", hsva.x, hsva.y, hsva.z, hsva.w);
}
str8_list_push (arena, &strs, str8_lit("}\n"));
str8_list_push (arena, &strs, str8_lit("\n"));
scratch_end(scratch);
}
}
}
//- rjf: write watch pins
{
B32 first = 1;
@@ -5742,6 +5799,25 @@ df_push_active_target_list(Arena *arena)
return active_targets;
}
//- rjf: expand key based entity queries
internal DF_Entity *
df_entity_from_expand_key_and_kind(DF_ExpandKey key, DF_EntityKind kind)
{
DF_Entity *result = &df_g_nil_entity;
DF_EntityList list = df_query_cached_entity_list_with_kind(kind);
for(DF_EntityNode *n = list.first; n != 0; n = n->next)
{
DF_Entity *entity = n->entity;
if(df_expand_key_match(df_expand_key_from_entity(entity), key))
{
result = entity;
break;
}
}
return result;
}
//- rjf: per-run caches
internal CTRL_Unwind
@@ -7496,6 +7572,14 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
df_entity_mark_for_deletion(n->entity);
}
}
DF_EntityList watches = df_query_cached_entity_list_with_kind(DF_EntityKind_Watch);
for(DF_EntityNode *n = watches.first; n != 0; n = n->next)
{
if(n->entity->cfg_src == src)
{
df_entity_mark_for_deletion(n->entity);
}
}
DF_EntityList pins = df_query_cached_entity_list_with_kind(DF_EntityKind_WatchPin);
for(DF_EntityNode *n = pins.first; n != 0; n = n->next)
{
@@ -7749,6 +7833,35 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
}
}
//- rjf: apply watches
DF_CfgVal *watches = df_cfg_val_from_string(table, str8_lit("watch"));
for(DF_CfgNode *watch = watches->first;
watch != &df_g_nil_cfg_node;
watch = watch->next)
{
if(watch->source != src)
{
continue;
}
Vec4F32 hsva = df_hsva_from_cfg_node(watch);
String8 expr_escaped = df_string_from_cfg_node_key(watch, str8_lit("expression"), StringMatchFlag_CaseInsensitive);
String8 view_rule_escaped = df_string_from_cfg_node_key(watch, str8_lit("view_rule"), StringMatchFlag_CaseInsensitive);
String8 expr = df_cfg_raw_from_escaped_string(scratch.arena, expr_escaped);
String8 view_rule = df_cfg_raw_from_escaped_string(scratch.arena, view_rule_escaped);
DF_Entity *entity = df_entity_alloc(0, df_entity_root(), DF_EntityKind_Watch);
df_entity_equip_cfg_src(entity, src);
df_entity_equip_name(0, entity, expr);
if(!memory_is_zero(&hsva, sizeof(hsva)))
{
df_entity_equip_color_hsva(entity, hsva);
}
if(view_rule.size != 0)
{
DF_Entity *view_rule_entity = df_entity_alloc(0, entity, DF_EntityKind_ViewRule);
df_entity_equip_name(0, view_rule_entity, view_rule);
}
}
//- rjf: apply watch pins
DF_CfgVal *pins = df_cfg_val_from_string(table, str8_lit("watch_pin"));
for(DF_CfgNode *pin = pins->first;
@@ -7892,7 +8005,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
}
else
{
df_entity_change_parent(0, map, map->parent, map_parent);
df_entity_change_parent(0, map, map->parent, map_parent, &df_g_nil_entity);
}
df_entity_equip_name(0, map, path_file);
}break;
@@ -8624,7 +8737,7 @@ df_core_end_frame(void)
}
// rjf: unhook & release this entity tree
df_entity_change_parent(0, entity, entity->parent, &df_g_nil_entity);
df_entity_change_parent(0, entity, entity->parent, &df_g_nil_entity, &df_g_nil_entity);
df_entity_release(0, entity);
}
}
+10 -3
View File
@@ -1425,6 +1425,10 @@ internal String8 df_search_tags_from_entity(Arena *arena, DF_Entity *entity);
internal Vec4F32 df_hsva_from_entity(DF_Entity *entity);
internal Vec4F32 df_rgba_from_entity(DF_Entity *entity);
//- rjf: entity -> expansion tree keys
internal DF_ExpandKey df_expand_key_from_entity(DF_Entity *entity);
internal DF_ExpandKey df_parent_expand_key_from_entity(DF_Entity *entity);
////////////////////////////////
//~ rjf: Name Allocation
@@ -1442,7 +1446,7 @@ internal void df_entity_notify_mutation(DF_Entity *entity);
internal DF_Entity *df_entity_alloc(DF_StateDeltaHistory *hist, DF_Entity *parent, DF_EntityKind kind);
internal void df_entity_mark_for_deletion(DF_Entity *entity);
internal void df_entity_release(DF_StateDeltaHistory *hist, DF_Entity *entity);
internal void df_entity_change_parent(DF_StateDeltaHistory *hist, DF_Entity *entity, DF_Entity *old_parent, DF_Entity *new_parent);
internal void df_entity_change_parent(DF_StateDeltaHistory *hist, DF_Entity *entity, DF_Entity *old_parent, DF_Entity *new_parent, DF_Entity *prev_child);
//- rjf: entity simple equipment
internal void df_entity_equip_txt_pt(DF_Entity *entity, TxtPt point);
@@ -1610,8 +1614,8 @@ internal DF_EvalLinkBaseArray df_eval_link_base_array_from_chunk_list(Arena *are
internal DF_EvalVizBlock *df_eval_viz_block_begin(Arena *arena, DF_EvalVizBlockKind kind, DF_ExpandKey parent_key, DF_ExpandKey key, S32 depth);
internal DF_EvalVizBlock *df_eval_viz_block_split_and_continue(Arena *arena, DF_EvalVizBlockList *list, DF_EvalVizBlock *split_block, U64 split_idx);
internal void df_eval_viz_block_end(DF_EvalVizBlockList *list, DF_EvalVizBlock *block);
internal void df_append_viz_blocks_for_parent__rec(Arena *arena, DI_Scope *scope, DF_EvalView *view, DF_ExpandKey parent_key, DF_ExpandKey key, String8 string, E_Eval eval, E_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_keys(Arena *arena, DI_Scope *scope, DF_EvalView *eval_view, String8 expr, DF_ExpandKey parent_key, DF_ExpandKey key);
internal void df_append_viz_blocks_for_parent__rec(Arena *arena, DF_EvalView *view, DF_ExpandKey parent_key, DF_ExpandKey key, String8 string, E_Eval eval, E_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_keys(Arena *arena, DF_EvalView *eval_view, String8 expr, DF_ExpandKey parent_key, DF_ExpandKey key);
internal void df_eval_viz_block_list_concat__in_place(DF_EvalVizBlockList *dst, DF_EvalVizBlockList *to_push);
//- rjf: viz block list <-> table coordinates
@@ -1672,6 +1676,9 @@ internal DF_EntityList df_query_cached_entity_list_with_kind(DF_EntityKind kind)
internal DI_KeyList df_push_active_dbgi_key_list(Arena *arena);
internal DF_EntityList df_push_active_target_list(Arena *arena);
//- rjf: expand key based entity queries
internal DF_Entity *df_entity_from_expand_key_and_kind(DF_ExpandKey key, DF_EntityKind kind);
//- rjf: per-run caches
internal CTRL_Unwind df_query_cached_unwind_from_thread(DF_Entity *thread);
internal U64 df_query_cached_rip_from_thread(DF_Entity *thread);
+4
View File
@@ -33,6 +33,10 @@ DF_EntityKindTable:
//- rjf: watch pins
{WatchPin watch_pin 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 1 "Expression" Pin "Watch Pin" }
//- rjf: watches
{Watch watch 1 0 0 1 1 0 1 0 0 0 0 0 0 0 0 1 1 "Expression" Binoculars "Watch" }
{ViewRule view_rule 1 0 0 1 1 0 1 0 0 0 0 0 0 0 0 1 1 "Expression" Binoculars "View Rule" }
//- rjf: breakpoints
{Breakpoint breakpoint 1 0 0 1 1 1 1 0 0 1 0 1 0 0 0 0 1 "Label" CircleFilled "Breakpoint" }
{Condition condition 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 "Expression" CircleFilled "Condition" }
+15 -5
View File
@@ -32,7 +32,7 @@ Rng1U64 df_g_cmd_param_slot_range_table[24] =
{OffsetOf(DF_CmdParams, inline_depth), OffsetOf(DF_CmdParams, inline_depth) + sizeof(U64)},
};
DF_IconKind df_g_entity_kind_icon_kind_table[25] =
DF_IconKind df_g_entity_kind_icon_kind_table[27] =
{
DF_IconKind_Null,
DF_IconKind_Null,
@@ -41,6 +41,8 @@ DF_IconKind_FileOutline,
DF_IconKind_FileOutline,
DF_IconKind_Binoculars,
DF_IconKind_Pin,
DF_IconKind_Binoculars,
DF_IconKind_Binoculars,
DF_IconKind_CircleFilled,
DF_IconKind_CircleFilled,
DF_IconKind_Target,
@@ -61,7 +63,7 @@ DF_IconKind_Null,
DF_IconKind_Null,
};
String8 df_g_entity_kind_display_string_table[25] =
String8 df_g_entity_kind_display_string_table[27] =
{
str8_lit_comp("Nil"),
str8_lit_comp("Root"),
@@ -70,6 +72,8 @@ str8_lit_comp("File"),
str8_lit_comp("Override File Link"),
str8_lit_comp("Auto View Rule"),
str8_lit_comp("Watch Pin"),
str8_lit_comp("Watch"),
str8_lit_comp("View Rule"),
str8_lit_comp("Breakpoint"),
str8_lit_comp("Condition"),
str8_lit_comp("Target"),
@@ -90,7 +94,7 @@ str8_lit_comp("Conversion Failure"),
str8_lit_comp("EndedProcess"),
};
String8 df_g_entity_kind_name_label_table[25] =
String8 df_g_entity_kind_name_label_table[27] =
{
str8_lit_comp("Label"),
str8_lit_comp("Label"),
@@ -99,6 +103,8 @@ str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Expression"),
str8_lit_comp("Expression"),
str8_lit_comp("Expression"),
str8_lit_comp("Label"),
str8_lit_comp("Expression"),
str8_lit_comp("Label"),
@@ -119,7 +125,7 @@ str8_lit_comp("Label"),
str8_lit_comp("Label"),
};
DF_EntityKindFlags df_g_entity_kind_flags_table[25] =
DF_EntityKindFlags df_g_entity_kind_flags_table[27] =
{
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
@@ -128,6 +134,8 @@ DF_EntityKindFlags df_g_entity_kind_flags_table[25] =
(1*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 1*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 1*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 1*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 1*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 1*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 1*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 1*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
@@ -148,7 +156,7 @@ DF_EntityKindFlags df_g_entity_kind_flags_table[25] =
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
};
DF_EntityOpFlags df_g_entity_kind_op_flags_table[25] =
DF_EntityOpFlags df_g_entity_kind_op_flags_table[27] =
{
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
@@ -157,6 +165,8 @@ DF_EntityOpFlags df_g_entity_kind_op_flags_table[25] =
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
(1*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (1*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (1*DF_EntityOpFlag_Duplicate),
(1*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (1*DF_EntityOpFlag_Rename) | (1*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (1*DF_EntityOpFlag_Duplicate),
(1*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (1*DF_EntityOpFlag_Rename) | (1*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (1*DF_EntityOpFlag_Duplicate),
(1*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (1*DF_EntityOpFlag_Rename) | (1*DF_EntityOpFlag_Enable) | (1*DF_EntityOpFlag_Condition) | (1*DF_EntityOpFlag_Duplicate),
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
(1*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (1*DF_EntityOpFlag_Edit) | (1*DF_EntityOpFlag_Rename) | (1*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (1*DF_EntityOpFlag_Duplicate),
+7 -5
View File
@@ -24,6 +24,8 @@ DF_EntityKind_File,
DF_EntityKind_OverrideFileLink,
DF_EntityKind_AutoViewRule,
DF_EntityKind_WatchPin,
DF_EntityKind_Watch,
DF_EntityKind_ViewRule,
DF_EntityKind_Breakpoint,
DF_EntityKind_Condition,
DF_EntityKind_Target,
@@ -1534,11 +1536,11 @@ struct {B32 *value_ptr; String8 name;} DEV_toggle_table[] =
};
C_LINKAGE_BEGIN
extern Rng1U64 df_g_cmd_param_slot_range_table[24];
extern DF_IconKind df_g_entity_kind_icon_kind_table[25];
extern String8 df_g_entity_kind_display_string_table[25];
extern String8 df_g_entity_kind_name_label_table[25];
extern DF_EntityKindFlags df_g_entity_kind_flags_table[25];
extern DF_EntityOpFlags df_g_entity_kind_op_flags_table[25];
extern DF_IconKind df_g_entity_kind_icon_kind_table[27];
extern String8 df_g_entity_kind_display_string_table[27];
extern String8 df_g_entity_kind_name_label_table[27];
extern DF_EntityKindFlags df_g_entity_kind_flags_table[27];
extern DF_EntityOpFlags df_g_entity_kind_op_flags_table[27];
extern String8 df_g_cfg_src_string_table[4];
extern DF_CoreCmdKind df_g_cfg_src_load_cmd_kind_table[4];
extern DF_CoreCmdKind df_g_cfg_src_write_cmd_kind_table[4];
+3 -3
View File
@@ -6212,7 +6212,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
DF_EvalView *eval_view = df_eval_view_from_key(eval_view_key);
DF_ExpandKey parent_key = df_expand_key_make(5381, 1);
DF_ExpandKey key = df_expand_key_make(df_hash_from_expand_key(parent_key), 1);
DF_EvalVizBlockList viz_blocks = df_eval_viz_block_list_from_eval_view_expr_keys(scratch.arena, scope, eval_view, expr, parent_key, key);
DF_EvalVizBlockList viz_blocks = df_eval_viz_block_list_from_eval_view_expr_keys(scratch.arena, eval_view, expr, parent_key, key);
U32 default_radix = (eval.mode == E_Mode_Reg ? 16 : 10);
DF_EvalVizWindowedRowList viz_rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, scope, eval_view, default_radix, ui_top_font(), ui_top_font_size(), r1s64(0, 50), &viz_blocks);
@@ -12011,7 +12011,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m
{
if(!df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file)))
{
df_entity_change_parent(0, dropped_entity, dropped_entity->parent, df_entity_from_handle(df_interact_regs()->file));
df_entity_change_parent(0, dropped_entity, dropped_entity->parent, df_entity_from_handle(df_interact_regs()->file), &df_g_nil_entity);
df_entity_equip_txt_pt(dropped_entity, txt_pt(line_num, 1));
if(dropped_entity->flags & DF_EntityFlag_HasVAddr)
{
@@ -12020,7 +12020,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m
}
else if(line_vaddr != 0)
{
df_entity_change_parent(0, dropped_entity, dropped_entity->parent, df_entity_root());
df_entity_change_parent(0, dropped_entity, dropped_entity->parent, df_entity_root(), &df_g_nil_entity);
df_entity_equip_vaddr(dropped_entity, line_vaddr);
}
}break;
+311 -570
View File
File diff suppressed because it is too large Load Diff
-26
View File
@@ -270,16 +270,6 @@ struct DF_ModulesViewState
////////////////////////////////
//~ rjf: Watch, Locals, Registers @view_types
typedef struct DF_EvalRoot DF_EvalRoot;
struct DF_EvalRoot
{
DF_EvalRoot *next;
DF_EvalRoot *prev;
U64 expr_buffer_string_size;
U64 expr_buffer_cap;
U8 *expr_buffer;
};
typedef enum DF_WatchViewColumnKind
{
DF_WatchViewColumnKind_Expr,
@@ -350,12 +340,6 @@ struct DF_WatchViewState
F32 value_column_pct;
F32 type_column_pct;
F32 view_rule_column_pct;
// rjf: mutable fill-kind root expression state
DF_EvalRoot *first_root;
DF_EvalRoot *last_root;
DF_EvalRoot *first_free_root;
U64 root_count;
};
////////////////////////////////
@@ -539,16 +523,6 @@ internal DF_CodeViewBuildResult df_code_view_build(Arena *arena, DF_Window *ws,
//- rjf: eval watch view instance -> eval view key
internal DF_EvalViewKey df_eval_view_key_from_eval_watch_view(DF_WatchViewState *ewv);
//- rjf: root allocation/deallocation/mutation
internal DF_EvalRoot * df_eval_root_alloc(DF_View *view, DF_WatchViewState *ews);
internal void df_eval_root_release(DF_WatchViewState *ews, DF_EvalRoot *root);
internal void df_eval_root_equip_string(DF_EvalRoot *root, String8 string);
internal DF_EvalRoot * df_eval_root_from_string(DF_WatchViewState *ews, String8 string);
internal DF_EvalRoot * df_eval_root_from_expand_key(DF_WatchViewState *ews, DF_EvalView *eval_view, DF_ExpandKey expand_key);
internal String8 df_string_from_eval_root(DF_EvalRoot *root);
internal DF_ExpandKey df_parent_expand_key_from_eval_root(DF_EvalRoot *root);
internal DF_ExpandKey df_expand_key_from_eval_root(DF_EvalRoot *root);
//- rjf: watch view points <-> table coordinates
internal B32 df_watch_view_point_match(DF_WatchViewPoint a, DF_WatchViewPoint b);
internal DF_WatchViewPoint df_watch_view_point_from_tbl(DF_EvalVizBlockList *blocks, Vec2S64 tbl);
-1
View File
@@ -380,7 +380,6 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
}
}
//////////////////////////////
//- rjf: determine frame time, record into history
//