From 9be3c2affc40fc1d3ed052b31889c439dd3bf29e Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Tue, 25 Jun 2024 17:02:43 -0700 Subject: [PATCH] sketch out 'interaction registers'; fix bp hit count tracking --- src/df/core/df_core.c | 2 +- src/df/core/df_core.h | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index 2f896e03..0a0b4569 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -7031,7 +7031,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt) if(bp->flags & DF_EntityFlag_HasTextPoint) { DF_Entity *bp_file = df_entity_ancestor_from_kind(bp, DF_EntityKind_File); - DF_LineList lines = df_lines_from_file_line_num(scratch.arena, bp_file, bp_file->text_point.line); + DF_LineList lines = df_lines_from_file_line_num(scratch.arena, bp_file, bp->text_point.line); for(DF_LineNode *n = lines.first; n != 0; n = n->next) { if(contains_1u64(n->v.voff_range, stop_thread_voff)) diff --git a/src/df/core/df_core.h b/src/df/core/df_core.h index 41e1534c..8f594ed2 100644 --- a/src/df/core/df_core.h +++ b/src/df/core/df_core.h @@ -653,6 +653,34 @@ struct DF_TextLineDasm2SrcInfoList U64 count; }; +//////////////////////////////// +//~ rjf: Interaction Context Register Types + +typedef struct DF_InteractRegs DF_InteractRegs; +struct DF_InteractRegs +{ + DF_Handle window; + DF_Handle panel; + DF_Handle view; + DF_Handle thread; + DF_Handle file; + TxtPt cursor; + TxtPt mark; + U64 unwind_count; + U64 inline_unwind_count; + U128 text_key; + TXT_LangKind lang_kind; + DF_LineList lines; + U64 vaddr; +}; + +typedef struct DF_InteractRegsNode DF_InteractRegsNode; +struct DF_InteractRegsNode +{ + DF_InteractRegsNode *next; + DF_InteractRegs v; +}; + //////////////////////////////// //~ rjf: Evaluation Visualization Types @@ -1202,6 +1230,11 @@ struct DF_State F32 dt; F32 seconds_til_autosave; + // rjf: interaction registers + Arena *frame_arenas[2]; + DF_InteractRegsNode base_interact_regs; + DF_InteractRegsNode *top_interact_regs; + // rjf: top-level command batch Arena *root_cmd_arena; DF_CmdList root_cmds; @@ -1734,6 +1767,9 @@ internal F32 df_dt(void); internal U64 df_frame_index(void); internal F64 df_time_in_seconds(void); +//- rjf: interaction registers +internal DF_InteractRegs *df_interact_regs(void); + //- rjf: undo/redo history internal DF_StateDeltaHistory *df_state_delta_history(void);