mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-12-02 18:43:20 -08:00
more progress on entity simplification; df -> rd; eliminate dbg_frontend distinction from raddbg layer
This commit is contained in:
1 parent
48ae9b6973
commit
8ffc9f4a9b
22 files changed
+9832
-10000
No files matched your search
@@ -0,0 +1,183 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#ifndef RADDBG_VIEWS_H
|
||||
#define RADDBG_VIEWS_H
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Code View Types
|
||||
|
||||
typedef U32 RD_CodeViewBuildFlags;
|
||||
enum
|
||||
{
|
||||
RD_CodeViewBuildFlag_Margins = (1<<0),
|
||||
RD_CodeViewBuildFlag_All = 0xffffffff,
|
||||
};
|
||||
|
||||
typedef struct RD_CodeViewState RD_CodeViewState;
|
||||
struct RD_CodeViewState
|
||||
{
|
||||
// rjf: stable state
|
||||
B32 initialized;
|
||||
S64 preferred_column;
|
||||
B32 drifted_for_search;
|
||||
|
||||
// rjf: per-frame command info
|
||||
S64 goto_line_num;
|
||||
B32 center_cursor;
|
||||
B32 contain_cursor;
|
||||
B32 watch_expr_at_mouse;
|
||||
Arena *find_text_arena;
|
||||
String8 find_text_fwd;
|
||||
String8 find_text_bwd;
|
||||
};
|
||||
|
||||
typedef struct RD_CodeViewBuildResult RD_CodeViewBuildResult;
|
||||
struct RD_CodeViewBuildResult
|
||||
{
|
||||
DI_KeyList dbgi_keys;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Watch View Types
|
||||
|
||||
typedef enum RD_WatchViewColumnKind
|
||||
{
|
||||
RD_WatchViewColumnKind_Expr,
|
||||
RD_WatchViewColumnKind_Value,
|
||||
RD_WatchViewColumnKind_Type,
|
||||
RD_WatchViewColumnKind_ViewRule,
|
||||
RD_WatchViewColumnKind_Module,
|
||||
RD_WatchViewColumnKind_FrameSelection,
|
||||
RD_WatchViewColumnKind_Member,
|
||||
RD_WatchViewColumnKind_COUNT
|
||||
}
|
||||
RD_WatchViewColumnKind;
|
||||
|
||||
typedef struct RD_WatchViewColumnParams RD_WatchViewColumnParams;
|
||||
struct RD_WatchViewColumnParams
|
||||
{
|
||||
String8 string;
|
||||
String8 display_string;
|
||||
String8 view_rule;
|
||||
B32 is_non_code;
|
||||
B32 dequote_string;
|
||||
};
|
||||
|
||||
typedef struct RD_WatchViewColumn RD_WatchViewColumn;
|
||||
struct RD_WatchViewColumn
|
||||
{
|
||||
RD_WatchViewColumn *next;
|
||||
RD_WatchViewColumn *prev;
|
||||
RD_WatchViewColumnKind kind;
|
||||
F32 pct;
|
||||
U8 string_buffer[1024];
|
||||
U64 string_size;
|
||||
U8 display_string_buffer[1024];
|
||||
U64 display_string_size;
|
||||
U8 view_rule_buffer[1024];
|
||||
U64 view_rule_size;
|
||||
B32 is_non_code;
|
||||
B32 dequote_string;
|
||||
};
|
||||
|
||||
typedef enum RD_WatchViewFillKind
|
||||
{
|
||||
RD_WatchViewFillKind_Watch,
|
||||
RD_WatchViewFillKind_Breakpoints,
|
||||
RD_WatchViewFillKind_WatchPins,
|
||||
RD_WatchViewFillKind_CallStack,
|
||||
RD_WatchViewFillKind_Registers,
|
||||
RD_WatchViewFillKind_Locals,
|
||||
RD_WatchViewFillKind_Globals,
|
||||
RD_WatchViewFillKind_ThreadLocals,
|
||||
RD_WatchViewFillKind_Types,
|
||||
RD_WatchViewFillKind_Procedures,
|
||||
RD_WatchViewFillKind_COUNT
|
||||
}
|
||||
RD_WatchViewFillKind;
|
||||
|
||||
typedef struct RD_WatchViewPoint RD_WatchViewPoint;
|
||||
struct RD_WatchViewPoint
|
||||
{
|
||||
S64 x;
|
||||
EV_Key parent_key;
|
||||
EV_Key key;
|
||||
};
|
||||
|
||||
typedef struct RD_WatchViewTextEditState RD_WatchViewTextEditState;
|
||||
struct RD_WatchViewTextEditState
|
||||
{
|
||||
RD_WatchViewTextEditState *pt_hash_next;
|
||||
RD_WatchViewPoint pt;
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
U8 input_buffer[1024];
|
||||
U64 input_size;
|
||||
U8 initial_buffer[1024];
|
||||
U64 initial_size;
|
||||
};
|
||||
|
||||
typedef struct RD_WatchViewState RD_WatchViewState;
|
||||
struct RD_WatchViewState
|
||||
{
|
||||
B32 initialized;
|
||||
|
||||
// rjf: fill kinds (way that the contents of the watch view are computed)
|
||||
RD_WatchViewFillKind fill_kind;
|
||||
|
||||
// rjf: column state
|
||||
Arena *column_arena;
|
||||
RD_WatchViewColumn *first_column;
|
||||
RD_WatchViewColumn *last_column;
|
||||
RD_WatchViewColumn *free_column;
|
||||
U64 column_count;
|
||||
|
||||
// rjf; table cursor state
|
||||
RD_WatchViewPoint cursor;
|
||||
RD_WatchViewPoint mark;
|
||||
RD_WatchViewPoint next_cursor;
|
||||
RD_WatchViewPoint next_mark;
|
||||
|
||||
// rjf: text input state
|
||||
Arena *text_edit_arena;
|
||||
U64 text_edit_state_slots_count;
|
||||
RD_WatchViewTextEditState dummy_text_edit_state;
|
||||
RD_WatchViewTextEditState **text_edit_state_slots;
|
||||
B32 text_editing;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Code View Functions
|
||||
|
||||
internal void rd_code_view_init(RD_CodeViewState *cv, RD_View *view);
|
||||
internal void rd_code_view_cmds(RD_View *view, RD_CodeViewState *cv, String8 text_data, TXT_TextInfo *text_info, DASM_LineArray *dasm_lines, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key);
|
||||
internal RD_CodeViewBuildResult rd_code_view_build(Arena *arena, RD_View *view, RD_CodeViewState *cv, RD_CodeViewBuildFlags flags, Rng2F32 rect, String8 text_data, TXT_TextInfo *text_info, DASM_LineArray *dasm_lines, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Watch View Functions
|
||||
|
||||
//- rjf: index -> column
|
||||
internal RD_WatchViewColumn *rd_watch_view_column_from_x(RD_WatchViewState *wv, S64 index);
|
||||
|
||||
//- rjf: watch view points <-> table coordinates
|
||||
internal B32 rd_watch_view_point_match(RD_WatchViewPoint a, RD_WatchViewPoint b);
|
||||
internal RD_WatchViewPoint rd_watch_view_point_from_tbl(EV_BlockList *blocks, Vec2S64 tbl);
|
||||
internal Vec2S64 rd_tbl_from_watch_view_point(EV_BlockList *blocks, RD_WatchViewPoint pt);
|
||||
|
||||
//- rjf: table coordinates -> strings
|
||||
internal String8 rd_string_from_eval_viz_row_column(Arena *arena, EV_View *ev, EV_Row *row, RD_WatchViewColumn *col, B32 editable, U32 default_radix, FNT_Tag font, F32 font_size, F32 max_size_px);
|
||||
|
||||
//- rjf: table coordinates -> text edit state
|
||||
internal RD_WatchViewTextEditState *rd_watch_view_text_edit_state_from_pt(RD_WatchViewState *wv, RD_WatchViewPoint pt);
|
||||
|
||||
//- rjf: watch view column state mutation
|
||||
internal RD_WatchViewColumn *rd_watch_view_column_alloc_(RD_WatchViewState *wv, RD_WatchViewColumnKind kind, F32 pct, RD_WatchViewColumnParams *params);
|
||||
#define rd_watch_view_column_alloc(wv, kind, pct, ...) rd_watch_view_column_alloc_((wv), (kind), (pct), &(RD_WatchViewColumnParams){.string = str8_zero(), __VA_ARGS__})
|
||||
internal void rd_watch_view_column_release(RD_WatchViewState *wv, RD_WatchViewColumn *col);
|
||||
|
||||
//- rjf: watch view main hooks
|
||||
internal void rd_watch_view_init(RD_WatchViewState *ewv, RD_View *view, RD_WatchViewFillKind fill_kind);
|
||||
internal void rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 default_radix, Rng2F32 rect);
|
||||
|
||||
#endif // RADDBG_VIEWS_H
|
||||
Reference in new issue
Block a user