stub out globals, thread-locals, types views; eliminate unnecssary uniquifier u64 in expand tree hash keys - simplify eval watch views to using a single eval view for the entire view, rather than allocating one per root expression. expand keys are now simply comprised of parent hash * child num

This commit is contained in:
Ryan Fleury
2024-01-31 10:39:18 -08:00
parent 8aac3f7bda
commit 14db7dbab4
11 changed files with 229 additions and 301 deletions
+22 -5
View File
@@ -274,11 +274,26 @@ typedef enum DF_EvalWatchViewColumnKind
}
DF_EvalWatchViewColumnKind;
typedef enum DF_EvalWatchViewFillKind
{
DF_EvalWatchViewFillKind_Mutable,
DF_EvalWatchViewFillKind_Registers,
DF_EvalWatchViewFillKind_Locals,
DF_EvalWatchViewFillKind_Globals,
DF_EvalWatchViewFillKind_ThreadLocals,
DF_EvalWatchViewFillKind_Types,
DF_EvalWatchViewFillKind_COUNT
}
DF_EvalWatchViewFillKind;
typedef struct DF_EvalWatchViewState DF_EvalWatchViewState;
struct DF_EvalWatchViewState
{
B32 initialized;
// rjf: fill kind (way that the contents of the watch view are computed)
DF_EvalWatchViewFillKind fill_kind;
// rjf; selection state
DF_EvalWatchViewColumnKind selected_column;
DF_ExpandKey selected_parent_key;
@@ -297,11 +312,10 @@ struct DF_EvalWatchViewState
F32 type_column_pct;
F32 view_rule_column_pct;
// rjf: top-level expression state
// rjf: mutable fill-kind root expression state
DF_EvalRoot *first_root;
DF_EvalRoot *last_root;
DF_EvalRoot *first_free_root;
U64 root_count;
};
typedef struct DF_EvalThreadDerivedReadOnlyWatchViewState DF_EvalThreadDerivedReadOnlyWatchViewState;
@@ -442,20 +456,23 @@ internal TXTI_TokenArray df_txti_token_array_from_dasm_arch_string(Arena *arena,
////////////////////////////////
//~ rjf: Eval/Watch Views
//- rjf: eval watch view instance -> eval view key
internal DF_EvalViewKey df_eval_view_key_from_eval_watch_view(DF_EvalWatchViewState *ewv);
//- rjf: root allocation/deallocation/mutation
internal DF_EvalRoot * df_eval_root_alloc(DF_View *view, DF_EvalWatchViewState *ews);
internal void df_eval_root_release(DF_EvalWatchViewState *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_EvalWatchViewState *ews, String8 string);
internal DF_EvalRoot * df_eval_root_from_expand_key(DF_EvalWatchViewState *ews, DF_ExpandKey expand_key);
internal DF_EvalRoot * df_eval_root_from_expand_key(DF_EvalWatchViewState *ews, DF_EvalView *eval_view, DF_ExpandKey expand_key);
internal String8 df_string_from_eval_root(DF_EvalRoot *root);
internal DF_ExpandKey df_expand_key_from_eval_root(DF_EvalRoot *root);
internal DF_ExpandKey df_expand_key_from_eval_view_root_expr_num(DF_EvalView *view, String8 root_expr, U64 num);
//- rjf: windowed watch tree visualization
internal DF_EvalVizBlockList df_eval_viz_block_list_from_watch_view_state(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_EvalWatchViewState *ews);
//- rjf: eval/watch views main hooks
internal void df_eval_watch_view_init(DF_EvalWatchViewState *ewv, DF_View *view);
internal void df_eval_watch_view_init(DF_EvalWatchViewState *ewv, DF_View *view, DF_EvalWatchViewFillKind fill_kind);
internal void df_eval_watch_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalWatchViewState *ewv, DF_CmdList *cmds);
internal void df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalWatchViewState *ewv, B32 modifiable, U32 default_radix, Rng2F32 rect);