mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-05 05:18:40 +00:00
merge
This commit is contained in:
+1733
-1140
File diff suppressed because it is too large
Load Diff
+573
-713
File diff suppressed because it is too large
Load Diff
+841
-591
File diff suppressed because it is too large
Load Diff
+11242
-10490
File diff suppressed because it is too large
Load Diff
+493
-851
File diff suppressed because it is too large
Load Diff
+110
-102
@@ -1,6 +1,48 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: 0.9.16 changes
|
||||
//
|
||||
// - Auto view rules have been upgraded to support type pattern-matching. This
|
||||
// makes them usable for generic types in various languages.
|
||||
// - The `slice` view rule has been streamlined and simplified. When an
|
||||
// expression with a `slice` view rule is expanded, it will simply expand to
|
||||
// the slice's contents, which matches the behavior with static arrays.
|
||||
// - The `slice` view rule now supports `first, one-past-last` pointer pairs,
|
||||
// as well as `base_pointer, length` pairs.
|
||||
// - The syntax for view rules has changed to improve its familiarity,
|
||||
// usability, and to improve its consistency with the rest of the evaluation
|
||||
// language. It now appears like function calls, and many arguments no longer
|
||||
// need to be explicitly named. For example, instead of
|
||||
// `bitmap:{w:1024, h:1024}`, the new view rule syntax would be
|
||||
// `bitmap(1024, 1024)`. Commas can still be omitted. Named arguments are
|
||||
// still possible (and required in some cases): `disasm(size=1024, arch=x64)`
|
||||
// - The hover evaluation feature has been majorly upgraded to support all
|
||||
// features normally available in the `Watch` view. Hover evaluations now
|
||||
// explicitly show type information, and contain a view rule column, which
|
||||
// can be edited in an identical way as the `Watch` view.
|
||||
// - Added "auto tabs", which are colored differently than normal tabs. These
|
||||
// tabs are automatically opened by the debugger when snapping to source code
|
||||
// which is not already opened. They are automatically replaced and recycled
|
||||
// when the debugger needs to snap to new locations. This will greatly reduce
|
||||
// the number of unused source code tabs accumulated throughout a debugging
|
||||
// session. These tabs can still be promoted to permanent tabs, in which case
|
||||
// they'll stay around until manually closed.
|
||||
// - The `Scheduler` view has been removed, in favor of three separate views,
|
||||
// which present various versions of the same information: `Threads`,
|
||||
// `Processes`, and `Machines`. The justification for this is that the
|
||||
// common case is debugging a small number of programs, usually 1, and for
|
||||
// those purposes, the `Threads` view is sufficient if not desirable, and
|
||||
// the extra information provided by `Processes` and `Machines`, while useful
|
||||
// in other contexts, is not useful in that common case.
|
||||
// - The two separate interfaces for editing threads, breakpoints, and watch
|
||||
// pins (the right-click context menu and the dedicated tabs) have been
|
||||
// merged.
|
||||
// - Added the ability to add per-target environment strings.
|
||||
// - Fixed an annoyance where the debugger would open a console window, even
|
||||
// for graphical programs, causing a flicker.
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: feature cleanup, code dedup, code elimination pass:
|
||||
//
|
||||
@@ -25,6 +67,17 @@
|
||||
// etc., all need to be merged, and optionally contextualized/filtered.
|
||||
// right-clicking a tab should be equivalent to spawning a command lister,
|
||||
// but only with commands that are directly
|
||||
//
|
||||
// [ ] r8 bitmap view rule seems incorrect?
|
||||
// [ ] crash bug, release mode - filter globals view (try with debugging raddbg, typing `dev` in globals view)
|
||||
//
|
||||
// [ ] stepping-onto a line with a conditional breakpoint, which fails, causes a
|
||||
// single step over the first instruction of that line, even if the thread
|
||||
// would've stopped at the first instruction due to the step, were that bp not
|
||||
// there.
|
||||
//
|
||||
// [ ] if a breakpoint matches the entry point's starting address, its hit count
|
||||
// is not correctly incremented.
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: post-0.9.12 TODO notes
|
||||
@@ -603,106 +656,58 @@ entry_point(CmdLine *cmd_line)
|
||||
String8List args = cmd_line->inputs;
|
||||
if(args.node_count > 0 && args.first->string.size != 0)
|
||||
{
|
||||
//- TODO(rjf): @cfg setup initial target from command line arguments
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
|
||||
//- rjf: unpack command line inputs
|
||||
String8 executable_name_string = {0};
|
||||
String8 arguments_string = {0};
|
||||
String8 working_directory_string = {0};
|
||||
{
|
||||
// rjf: unpack full executable path
|
||||
if(args.first->string.size != 0)
|
||||
{
|
||||
String8 current_path = os_get_current_path(scratch.arena);
|
||||
String8 exe_name = args.first->string;
|
||||
PathStyle style = path_style_from_str8(exe_name);
|
||||
if(style == PathStyle_Relative)
|
||||
{
|
||||
exe_name = push_str8f(scratch.arena, "%S/%S", current_path, exe_name);
|
||||
exe_name = path_normalized_from_string(scratch.arena, exe_name);
|
||||
}
|
||||
executable_name_string = exe_name;
|
||||
}
|
||||
|
||||
// rjf: unpack working directory
|
||||
if(args.first->string.size != 0)
|
||||
{
|
||||
String8 path_part_of_arg = str8_chop_last_slash(args.first->string);
|
||||
if(path_part_of_arg.size != 0)
|
||||
{
|
||||
String8 path = push_str8f(scratch.arena, "%S/", path_part_of_arg);
|
||||
working_directory_string = path;
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: unpack arguments
|
||||
String8List passthrough_args_list = {0};
|
||||
for(String8Node *n = args.first->next; n != 0; n = n->next)
|
||||
{
|
||||
str8_list_push(scratch.arena, &passthrough_args_list, n->string);
|
||||
}
|
||||
StringJoin join = {str8_lit(""), str8_lit(" "), str8_lit("")};
|
||||
arguments_string = str8_list_join(scratch.arena, &passthrough_args_list, &join);
|
||||
}
|
||||
|
||||
//- rjf: build config tree
|
||||
RD_Cfg *command_line_root = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("command_line"));
|
||||
RD_Cfg *target = rd_cfg_new(command_line_root, str8_lit("target"));
|
||||
RD_Cfg *exe = rd_cfg_new(target, str8_lit("executable"));
|
||||
RD_Cfg *args = rd_cfg_new(target, str8_lit("arguments"));
|
||||
RD_Cfg *wdir = rd_cfg_new(target, str8_lit("working_directory"));
|
||||
rd_cfg_new(exe, executable_name_string);
|
||||
rd_cfg_new(args, arguments_string);
|
||||
rd_cfg_new(wdir, working_directory_string);
|
||||
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
RD_Entity *target = rd_entity_alloc(rd_entity_root(), RD_EntityKind_Target);
|
||||
rd_entity_equip_cfg_src(target, RD_CfgSrc_CommandLine);
|
||||
String8List passthrough_args_list = {0};
|
||||
for(String8Node *n = args.first->next; n != 0; n = n->next)
|
||||
{
|
||||
str8_list_push(scratch.arena, &passthrough_args_list, n->string);
|
||||
}
|
||||
|
||||
// rjf: get current path
|
||||
String8 current_path = os_get_current_path(scratch.arena);
|
||||
|
||||
// rjf: equip exe
|
||||
if(args.first->string.size != 0)
|
||||
//- rjf: unpack command line inputs
|
||||
String8 executable_name_string = {0};
|
||||
String8 arguments_string = {0};
|
||||
String8 working_directory_string = {0};
|
||||
{
|
||||
String8 exe_name = args.first->string;
|
||||
RD_Entity *exe = rd_entity_alloc(target, RD_EntityKind_Executable);
|
||||
PathStyle style = path_style_from_str8(exe_name);
|
||||
if(style == PathStyle_Relative)
|
||||
// rjf: unpack full executable path
|
||||
if(args.first->string.size != 0)
|
||||
{
|
||||
exe_name = push_str8f(scratch.arena, "%S/%S", current_path, exe_name);
|
||||
exe_name = path_normalized_from_string(scratch.arena, exe_name);
|
||||
String8 current_path = os_get_current_path(scratch.arena);
|
||||
String8 exe_name = args.first->string;
|
||||
PathStyle style = path_style_from_str8(exe_name);
|
||||
if(style == PathStyle_Relative)
|
||||
{
|
||||
exe_name = push_str8f(scratch.arena, "%S/%S", current_path, exe_name);
|
||||
exe_name = path_normalized_from_string(scratch.arena, exe_name);
|
||||
}
|
||||
executable_name_string = exe_name;
|
||||
}
|
||||
rd_entity_equip_name(exe, exe_name);
|
||||
|
||||
// rjf: unpack working directory
|
||||
if(args.first->string.size != 0)
|
||||
{
|
||||
String8 path_part_of_arg = str8_chop_last_slash(args.first->string);
|
||||
if(path_part_of_arg.size != 0)
|
||||
{
|
||||
String8 path = push_str8f(scratch.arena, "%S/", path_part_of_arg);
|
||||
working_directory_string = path;
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: unpack arguments
|
||||
String8List passthrough_args_list = {0};
|
||||
for(String8Node *n = args.first->next; n != 0; n = n->next)
|
||||
{
|
||||
str8_list_push(scratch.arena, &passthrough_args_list, n->string);
|
||||
}
|
||||
StringJoin join = {str8_lit(""), str8_lit(" "), str8_lit("")};
|
||||
arguments_string = str8_list_join(scratch.arena, &passthrough_args_list, &join);
|
||||
}
|
||||
|
||||
// rjf: equip working directory
|
||||
String8 path_part_of_arg = str8_chop_last_slash(args.first->string);
|
||||
if(path_part_of_arg.size != 0)
|
||||
{
|
||||
String8 path = push_str8f(scratch.arena, "%S/", path_part_of_arg);
|
||||
RD_Entity *wdir = rd_entity_alloc(target, RD_EntityKind_WorkingDirectory);
|
||||
rd_entity_equip_name(wdir, path);
|
||||
}
|
||||
//- rjf: build config tree
|
||||
RD_Cfg *command_line_root = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("command_line"));
|
||||
RD_Cfg *target = rd_cfg_new(command_line_root, str8_lit("target"));
|
||||
RD_Cfg *exe = rd_cfg_new(target, str8_lit("executable"));
|
||||
RD_Cfg *args = rd_cfg_new(target, str8_lit("arguments"));
|
||||
RD_Cfg *wdir = rd_cfg_new(target, str8_lit("working_directory"));
|
||||
rd_cfg_new(exe, executable_name_string);
|
||||
rd_cfg_new(args, arguments_string);
|
||||
rd_cfg_new(wdir, working_directory_string);
|
||||
|
||||
// rjf: equip args
|
||||
StringJoin join = {str8_lit(""), str8_lit(" "), str8_lit("")};
|
||||
String8 args_str = str8_list_join(scratch.arena, &passthrough_args_list, &join);
|
||||
if(args_str.size != 0)
|
||||
{
|
||||
RD_Entity *args_entity = rd_entity_alloc(target, RD_EntityKind_Arguments);
|
||||
rd_entity_equip_name(args_entity, args_str);
|
||||
}
|
||||
scratch_end(scratch);
|
||||
}
|
||||
}
|
||||
@@ -754,29 +759,32 @@ entry_point(CmdLine *cmd_line)
|
||||
if(msg.size != 0)
|
||||
{
|
||||
log_infof("ipc_msg: \"%S\"", msg);
|
||||
RD_Window *dst_window = rd_state->first_window;
|
||||
for(RD_Window *window = dst_window; window != 0; window = window->next)
|
||||
RD_WindowState *dst_ws = rd_state->first_window_state;
|
||||
for(RD_WindowState *ws = dst_ws; ws != &rd_nil_window_state; ws = ws->order_next)
|
||||
{
|
||||
if(os_window_is_focused(window->os))
|
||||
if(os_window_is_focused(ws->os))
|
||||
{
|
||||
dst_window = window;
|
||||
dst_ws = ws;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(dst_window != 0)
|
||||
if(dst_ws != &rd_nil_window_state)
|
||||
{
|
||||
dst_window->window_temporarily_focused_ipc = 1;
|
||||
dst_ws->window_temporarily_focused_ipc = 1;
|
||||
U64 first_space_pos = str8_find_needle(msg, 0, str8_lit(" "), 0);
|
||||
String8 cmd_kind_name_string = str8_prefix(msg, first_space_pos);
|
||||
String8 cmd_args_string = str8_skip_chop_whitespace(str8_skip(msg, first_space_pos));
|
||||
RD_CmdKindInfo *cmd_kind_info = rd_cmd_kind_info_from_string(cmd_kind_name_string);
|
||||
if(cmd_kind_info != &rd_nil_cmd_kind_info) RD_RegsScope()
|
||||
{
|
||||
if(dst_window != rd_window_from_handle(rd_regs()->window))
|
||||
if(dst_ws->cfg_id != rd_regs()->window)
|
||||
{
|
||||
rd_regs()->window = rd_handle_from_window(dst_window);
|
||||
rd_regs()->panel = rd_handle_from_panel(dst_window->focused_panel);
|
||||
rd_regs()->view = dst_window->focused_panel->selected_tab_view;
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
RD_PanelTree panel_tree = rd_panel_tree_from_cfg(scratch.arena, rd_cfg_from_id(dst_ws->cfg_id));
|
||||
rd_regs()->window = dst_ws->cfg_id;
|
||||
rd_regs()->panel = panel_tree.focused->cfg->id;
|
||||
rd_regs()->view = panel_tree.focused->selected_tab->id;
|
||||
scratch_end(scratch);
|
||||
}
|
||||
rd_regs_fill_slot_from_string(cmd_kind_info->query.slot, cmd_args_string);
|
||||
rd_push_cmd(cmd_kind_name_string, rd_regs());
|
||||
|
||||
+1012
-6092
File diff suppressed because it is too large
Load Diff
+123
-71
@@ -10,8 +10,8 @@
|
||||
typedef U32 RD_CodeViewBuildFlags;
|
||||
enum
|
||||
{
|
||||
RD_CodeViewBuildFlag_Margins = (1<<0),
|
||||
RD_CodeViewBuildFlag_All = 0xffffffff,
|
||||
RD_CodeViewBuildFlag_Margins = (1<<0),
|
||||
RD_CodeViewBuildFlag_All = 0xffffffff,
|
||||
};
|
||||
|
||||
typedef struct RD_CodeViewState RD_CodeViewState;
|
||||
@@ -41,13 +41,85 @@ struct RD_CodeViewBuildResult
|
||||
////////////////////////////////
|
||||
//~ rjf: Watch View Types
|
||||
|
||||
typedef U32 RD_WatchViewFlags;
|
||||
typedef enum RD_WatchCellKind
|
||||
{
|
||||
RD_WatchCellKind_Expr, // strings to represent expression itself
|
||||
RD_WatchCellKind_Tag, // strings to represent attached tags at row-granularity
|
||||
RD_WatchCellKind_Eval, // an evaluation of the expression, with some optional modification - e.g. `$expr.some_member`, or `typeof($expr)`
|
||||
RD_WatchCellKind_ViewUI, // an arbitrary user interface, supplied by a hook
|
||||
RD_WatchCellKind_CallStackFrame, // a slot for a yellow arrow, to show call stack frame selection
|
||||
}
|
||||
RD_WatchCellKind;
|
||||
|
||||
typedef U32 RD_WatchCellFlags;
|
||||
enum
|
||||
{
|
||||
RD_WatchViewFlag_NoHeader = (1<<0),
|
||||
RD_WatchViewFlag_PrettyNameMembers = (1<<1),
|
||||
RD_WatchViewFlag_PrettyEntityRows = (1<<2),
|
||||
RD_WatchViewFlag_DisableCacheLines = (1<<3),
|
||||
RD_WatchCellFlag_Button = (1<<0),
|
||||
RD_WatchCellFlag_Background = (1<<1),
|
||||
RD_WatchCellFlag_ActivateWithSingleClick = (1<<2),
|
||||
RD_WatchCellFlag_IsNonCode = (1<<3),
|
||||
RD_WatchCellFlag_CanEdit = (1<<4),
|
||||
RD_WatchCellFlag_IsErrored = (1<<5),
|
||||
};
|
||||
|
||||
typedef struct RD_WatchCell RD_WatchCell;
|
||||
struct RD_WatchCell
|
||||
{
|
||||
RD_WatchCell *next;
|
||||
RD_WatchCellKind kind;
|
||||
U64 index;
|
||||
String8 string;
|
||||
E_Eval eval;
|
||||
DR_FStrList fstrs;
|
||||
RD_WatchCellFlags flags;
|
||||
F32 default_pct;
|
||||
F32 pct;
|
||||
F32 px;
|
||||
};
|
||||
|
||||
typedef struct RD_WatchCellList RD_WatchCellList;
|
||||
struct RD_WatchCellList
|
||||
{
|
||||
RD_WatchCell *first;
|
||||
RD_WatchCell *last;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
typedef struct RD_WatchRowInfo RD_WatchRowInfo;
|
||||
struct RD_WatchRowInfo
|
||||
{
|
||||
E_Eval eval;
|
||||
CTRL_Entity *module;
|
||||
B32 can_expand;
|
||||
B32 expr_is_editable;
|
||||
String8 group_cfg_name;
|
||||
RD_Cfg *group_cfg_parent;
|
||||
RD_Cfg *group_cfg_child;
|
||||
CTRL_Entity *group_entity;
|
||||
CTRL_Entity *callstack_thread;
|
||||
U64 callstack_unwind_index;
|
||||
U64 callstack_inline_depth;
|
||||
U64 callstack_vaddr;
|
||||
String8 cell_style_key;
|
||||
RD_WatchCellList cells;
|
||||
RD_ViewUIRule *view_ui_rule;
|
||||
E_Expr *view_ui_tag;
|
||||
};
|
||||
|
||||
typedef struct RD_WatchRowCellInfo RD_WatchRowCellInfo;
|
||||
struct RD_WatchRowCellInfo
|
||||
{
|
||||
RD_WatchCellFlags flags;
|
||||
E_Eval eval;
|
||||
RD_Cfg *cfg;
|
||||
CTRL_Entity *entity;
|
||||
String8 cmd_name;
|
||||
String8 string;
|
||||
DR_FStrList fstrs;
|
||||
String8 error_tooltip;
|
||||
String8 inheritance_tooltip;
|
||||
RD_ViewUIRule *view_ui_rule;
|
||||
E_Expr *view_ui_tag;
|
||||
};
|
||||
|
||||
typedef enum RD_WatchViewColumnKind
|
||||
@@ -93,48 +165,19 @@ struct RD_WatchViewColumn
|
||||
B32 rangify_braces;
|
||||
};
|
||||
|
||||
typedef struct RD_WatchViewRowCtrl RD_WatchViewRowCtrl;
|
||||
struct RD_WatchViewRowCtrl
|
||||
typedef struct RD_WatchPt RD_WatchPt;
|
||||
struct RD_WatchPt
|
||||
{
|
||||
RD_EntityKind entity_kind;
|
||||
CTRL_EntityKind ctrl_entity_kind;
|
||||
RD_CmdKind kind;
|
||||
};
|
||||
|
||||
typedef enum RD_WatchViewRowKind
|
||||
{
|
||||
RD_WatchViewRowKind_Normal,
|
||||
RD_WatchViewRowKind_Header,
|
||||
RD_WatchViewRowKind_Canvas,
|
||||
RD_WatchViewRowKind_PrettyEntityControls,
|
||||
}
|
||||
RD_WatchViewRowKind;
|
||||
|
||||
typedef struct RD_WatchViewPoint RD_WatchViewPoint;
|
||||
struct RD_WatchViewPoint
|
||||
{
|
||||
S64 x;
|
||||
EV_Key parent_key;
|
||||
EV_Key key;
|
||||
};
|
||||
|
||||
typedef struct RD_WatchViewRowInfo RD_WatchViewRowInfo;
|
||||
struct RD_WatchViewRowInfo
|
||||
{
|
||||
RD_EntityKind collection_entity_kind;
|
||||
RD_Entity *collection_entity;
|
||||
CTRL_EntityKind collection_ctrl_entity_kind;
|
||||
CTRL_Entity *collection_ctrl_entity;
|
||||
CTRL_Entity *callstack_thread;
|
||||
U64 callstack_unwind_index;
|
||||
U64 callstack_inline_depth;
|
||||
U64 cell_id;
|
||||
};
|
||||
|
||||
typedef struct RD_WatchViewTextEditState RD_WatchViewTextEditState;
|
||||
struct RD_WatchViewTextEditState
|
||||
{
|
||||
RD_WatchViewTextEditState *pt_hash_next;
|
||||
RD_WatchViewPoint pt;
|
||||
RD_WatchPt pt;
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
U8 input_buffer[1024];
|
||||
@@ -148,18 +191,15 @@ struct RD_WatchViewState
|
||||
{
|
||||
B32 initialized;
|
||||
|
||||
// rjf: column state
|
||||
Arena *column_arena;
|
||||
RD_WatchViewColumn *first_column;
|
||||
RD_WatchViewColumn *last_column;
|
||||
RD_WatchViewColumn *free_column;
|
||||
U64 column_count;
|
||||
// rjf: filter history
|
||||
Arena *filter_arena;
|
||||
String8 last_filter;
|
||||
|
||||
// rjf; table cursor state
|
||||
RD_WatchViewPoint cursor;
|
||||
RD_WatchViewPoint mark;
|
||||
RD_WatchViewPoint next_cursor;
|
||||
RD_WatchViewPoint next_mark;
|
||||
RD_WatchPt cursor;
|
||||
RD_WatchPt mark;
|
||||
RD_WatchPt next_cursor;
|
||||
RD_WatchPt next_mark;
|
||||
|
||||
// rjf: text input state
|
||||
Arena *text_edit_arena;
|
||||
@@ -178,34 +218,46 @@ internal RD_CodeViewBuildResult rd_code_view_build(Arena *arena, RD_CodeViewStat
|
||||
////////////////////////////////
|
||||
//~ rjf: Watch View Functions
|
||||
|
||||
//- rjf: index -> column
|
||||
internal RD_WatchViewColumn *rd_watch_view_column_from_x(RD_WatchViewState *wv, S64 index);
|
||||
//- rjf: cell list building
|
||||
internal U64 rd_id_from_watch_cell(RD_WatchCell *cell);
|
||||
internal RD_WatchCell *rd_watch_cell_list_push(Arena *arena, RD_WatchCellList *list);
|
||||
internal RD_WatchCell *rd_watch_cell_list_push_new_(Arena *arena, RD_WatchCellList *list, RD_WatchCell *params);
|
||||
#define rd_watch_cell_list_push_new(arena, list, kind_, ...) rd_watch_cell_list_push_new_((arena), (list), &(RD_WatchCell){.kind = (kind_), __VA_ARGS__})
|
||||
|
||||
//- 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_BlockRangeList *block_ranges, Vec2S64 tbl);
|
||||
internal Vec2S64 rd_tbl_from_watch_view_point(EV_BlockRangeList *block_ranges, RD_WatchViewPoint pt);
|
||||
internal B32 rd_watch_pt_match(RD_WatchPt a, RD_WatchPt b);
|
||||
internal RD_WatchPt rd_watch_pt_from_tbl(EV_BlockRangeList *block_ranges, Vec2S64 tbl);
|
||||
internal Vec2S64 rd_tbl_from_watch_pt(EV_BlockRangeList *block_ranges, RD_WatchPt pt);
|
||||
|
||||
//- rjf: row -> context info
|
||||
internal RD_WatchViewRowInfo rd_watch_view_row_info_from_row(EV_Row *row);
|
||||
//- rjf: row -> info
|
||||
internal RD_WatchRowInfo rd_watch_row_info_from_row(Arena *arena, EV_Row *row);
|
||||
|
||||
//- rjf: watch view flags & row & row info -> row kind
|
||||
internal RD_WatchViewRowKind rd_watch_view_row_kind_from_flags_row_info(RD_WatchViewFlags flags, EV_Row *row, RD_WatchViewRowInfo *info);
|
||||
|
||||
//- rjf: row/column -> exprs / strings
|
||||
internal E_Expr *rd_expr_from_watch_view_row_column(Arena *arena, EV_View *ev_view, EV_Row *row, RD_WatchViewColumn *col);
|
||||
internal String8 rd_string_from_eval_viz_row_column(Arena *arena, EV_View *ev, EV_Row *row, RD_WatchViewColumn *col, EV_StringFlags string_flags, U32 default_radix, FNT_Tag font, F32 font_size, F32 max_size_px);
|
||||
//- rjf: row * cell -> info
|
||||
internal RD_WatchRowCellInfo rd_info_from_watch_row_cell(Arena *arena, EV_Row *row, EV_StringFlags string_flags, RD_WatchRowInfo *row_info, RD_WatchCell *cell, 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);
|
||||
internal RD_WatchViewTextEditState *rd_watch_view_text_edit_state_from_pt(RD_WatchViewState *wv, RD_WatchPt 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: View Hooks
|
||||
|
||||
//- rjf: watch view main hooks
|
||||
internal void rd_watch_view_init(RD_WatchViewState *ewv);
|
||||
internal void rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 root_expr, String8 root_view_rule, B32 modifiable, U32 default_radix, Rng2F32 rect);
|
||||
// TODO(rjf): eliminate once we are predeclaring these with metacode
|
||||
|
||||
RD_VIEW_UI_FUNCTION_DEF(null);
|
||||
|
||||
EV_EXPAND_RULE_INFO_FUNCTION_DEF(text);
|
||||
EV_EXPAND_RULE_INFO_FUNCTION_DEF(disasm);
|
||||
EV_EXPAND_RULE_INFO_FUNCTION_DEF(memory);
|
||||
EV_EXPAND_RULE_INFO_FUNCTION_DEF(bitmap);
|
||||
EV_EXPAND_RULE_INFO_FUNCTION_DEF(color_rgba);
|
||||
EV_EXPAND_RULE_INFO_FUNCTION_DEF(geo3d);
|
||||
|
||||
RD_VIEW_UI_FUNCTION_DEF(text);
|
||||
RD_VIEW_UI_FUNCTION_DEF(disasm);
|
||||
RD_VIEW_UI_FUNCTION_DEF(memory);
|
||||
RD_VIEW_UI_FUNCTION_DEF(bitmap);
|
||||
RD_VIEW_UI_FUNCTION_DEF(checkbox);
|
||||
RD_VIEW_UI_FUNCTION_DEF(color_rgba);
|
||||
RD_VIEW_UI_FUNCTION_DEF(geo3d);
|
||||
|
||||
#endif // RADDBG_VIEWS_H
|
||||
|
||||
+1205
-430
File diff suppressed because it is too large
Load Diff
+68
-17
@@ -5,21 +5,64 @@
|
||||
#define RADDBG_WIDGETS_H
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Line Edit Types
|
||||
//~ rjf: Cell Types
|
||||
|
||||
typedef U32 RD_LineEditFlags;
|
||||
typedef U32 RD_CellFlags;
|
||||
enum
|
||||
{
|
||||
RD_LineEditFlag_Expander = (1<<0),
|
||||
RD_LineEditFlag_ExpanderSpace = (1<<1),
|
||||
RD_LineEditFlag_ExpanderPlaceholder = (1<<2),
|
||||
RD_LineEditFlag_DisableEdit = (1<<3),
|
||||
RD_LineEditFlag_CodeContents = (1<<4),
|
||||
RD_LineEditFlag_KeyboardClickable = (1<<5),
|
||||
RD_LineEditFlag_Border = (1<<6),
|
||||
RD_LineEditFlag_NoBackground = (1<<7),
|
||||
RD_LineEditFlag_PreferDisplayString = (1<<8),
|
||||
RD_LineEditFlag_DisplayStringIsCode = (1<<9),
|
||||
//- rjf: expander
|
||||
RD_CellFlag_Expander = (1<<0),
|
||||
RD_CellFlag_ExpanderSpace = (1<<1),
|
||||
RD_CellFlag_ExpanderPlaceholder = (1<<2),
|
||||
|
||||
//- rjf: toggle switch extension
|
||||
RD_CellFlag_ToggleSwitch = (1<<3),
|
||||
|
||||
//- rjf: slider extension
|
||||
RD_CellFlag_Slider = (1<<4),
|
||||
|
||||
//- rjf: behavior
|
||||
RD_CellFlag_DisableEdit = (1<<5),
|
||||
RD_CellFlag_KeyboardClickable = (1<<6),
|
||||
RD_CellFlag_SingleClickActivate = (1<<7),
|
||||
|
||||
//- rjf: contents description
|
||||
RD_CellFlag_CodeContents = (1<<8),
|
||||
|
||||
//- rjf: appearance
|
||||
RD_CellFlag_Border = (1<<9),
|
||||
RD_CellFlag_NoBackground = (1<<10),
|
||||
RD_CellFlag_Button = (1<<11),
|
||||
RD_CellFlag_PreferDisplayString = (1<<12),
|
||||
RD_CellFlag_DisplayStringIsCode = (1<<13),
|
||||
};
|
||||
|
||||
typedef struct RD_CellParams RD_CellParams;
|
||||
struct RD_CellParams
|
||||
{
|
||||
//- rjf: catachall parameters
|
||||
RD_CellFlags flags;
|
||||
S32 depth;
|
||||
FuzzyMatchRangeList *fuzzy_matches;
|
||||
String8 pre_edit_value;
|
||||
DR_FStrList fstrs;
|
||||
|
||||
//- rjf: expander r/w info
|
||||
B32 *expanded_out;
|
||||
|
||||
//- rjf: toggle-switch r/w info
|
||||
B32 *toggled_out;
|
||||
|
||||
//- rjf: slider info r/w info
|
||||
Rng1U64 slider_value_range;
|
||||
U64 *slider_value_out;
|
||||
|
||||
//- rjf: text editing r/w info
|
||||
TxtPt *cursor;
|
||||
TxtPt *mark;
|
||||
U8 *edit_buffer;
|
||||
U64 edit_buffer_size;
|
||||
U64 *edit_string_size_out;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -43,9 +86,9 @@ struct RD_CodeSliceParams
|
||||
String8 *line_text;
|
||||
Rng1U64 *line_ranges;
|
||||
TXT_TokenArray *line_tokens;
|
||||
RD_EntityList *line_bps;
|
||||
RD_CfgList *line_bps;
|
||||
CTRL_EntityList *line_ips;
|
||||
RD_EntityList *line_pins;
|
||||
RD_CfgList *line_pins;
|
||||
U64 *line_vaddrs;
|
||||
D_LineList *line_infos;
|
||||
DI_KeyList relevant_dbgi_keys;
|
||||
@@ -77,6 +120,14 @@ struct RD_CodeSliceSignal
|
||||
#define RD_Palette(code) UI_Palette(rd_palette_from_code(code))
|
||||
#define RD_Font(slot) UI_Font(rd_font_from_slot(slot)) UI_TextRasterFlags(rd_raster_flags_from_slot((slot)))
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: UI Widgets: Fancy Title Strings
|
||||
|
||||
internal DR_FStrList rd_title_fstrs_from_cfg(Arena *arena, RD_Cfg *cfg);
|
||||
internal DR_FStrList rd_title_fstrs_from_ctrl_entity(Arena *arena, CTRL_Entity *entity, B32 include_extras);
|
||||
internal DR_FStrList rd_title_fstrs_from_code_name(Arena *arena, String8 code_name);
|
||||
internal DR_FStrList rd_title_fstrs_from_file_path(Arena *arena, String8 file_path);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: UI Widgets: Loading Overlay
|
||||
|
||||
@@ -108,13 +159,13 @@ internal B32 rd_do_txt_controls(TXT_TextInfo *info, String8 data, U64 line_count
|
||||
internal UI_Signal rd_label(String8 string);
|
||||
internal UI_Signal rd_error_label(String8 string);
|
||||
internal B32 rd_help_label(String8 string);
|
||||
internal DR_FancyStringList rd_fancy_string_list_from_code_string(Arena *arena, F32 alpha, B32 indirection_size_change, Vec4F32 base_color, String8 string);
|
||||
internal DR_FStrList rd_fstrs_from_code_string(Arena *arena, F32 alpha, B32 indirection_size_change, Vec4F32 base_color, String8 string);
|
||||
internal UI_Box *rd_code_label(F32 alpha, B32 indirection_size_change, Vec4F32 base_color, String8 string);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: UI Widgets: Line Edit
|
||||
|
||||
internal UI_Signal rd_line_edit(RD_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, String8 string);
|
||||
internal UI_Signal rd_line_editf(RD_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, char *fmt, ...);
|
||||
internal UI_Signal rd_cell(RD_CellParams *params, String8 string);
|
||||
internal UI_Signal rd_cellf(RD_CellParams *params, char *fmt, ...);
|
||||
|
||||
#endif // RADDBG_WIDGETS_H
|
||||
|
||||
Reference in New Issue
Block a user