mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-15 00:22:23 -07:00
collapse all watch-table watch window view rules into specializations of singular watch view path
This commit is contained in:
@@ -719,7 +719,7 @@ str8_lit_comp("5"),
|
||||
str8_lit_comp("c"),
|
||||
};
|
||||
|
||||
RD_ViewRuleInfo rd_view_rule_kind_info_table[28] =
|
||||
RD_ViewRuleInfo rd_view_rule_kind_info_table[13] =
|
||||
{
|
||||
{{0}, {0}, {0}, {0}, RD_IconKind_Null, 0, EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(null)},
|
||||
{str8_lit_comp("empty"), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), RD_IconKind_Null, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(empty)},
|
||||
@@ -727,23 +727,8 @@ RD_ViewRuleInfo rd_view_rule_kind_info_table[28] =
|
||||
{str8_lit_comp("settings"), str8_lit_comp("An interface to modify general settings for the debugger's appearance and behavior."), str8_lit_comp("Settings"), str8_lit_comp(""), RD_IconKind_Gear, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(settings)},
|
||||
{str8_lit_comp("pending_file"), str8_lit_comp(""), str8_lit_comp("Pending File"), str8_lit_comp(""), RD_IconKind_FileOutline, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(pending_file)},
|
||||
{str8_lit_comp("watch"), str8_lit_comp("The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section."), str8_lit_comp("Watch"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(watch)},
|
||||
{str8_lit_comp("locals"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with local variables found within the selected call stack frame of the selected thread, according to the associated debug info. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Locals"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(locals)},
|
||||
{str8_lit_comp("registers"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with all register names according to the selected thread's architecture. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Registers"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(registers)},
|
||||
{str8_lit_comp("globals"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with all global variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Globals"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(globals)},
|
||||
{str8_lit_comp("thread_locals"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with all thread local variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Thread Locals"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(thread_locals)},
|
||||
{str8_lit_comp("types"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with all types within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Types"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(types)},
|
||||
{str8_lit_comp("procedures"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with all procedures within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Procedures"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(procedures)},
|
||||
{str8_lit_comp("targets"), str8_lit_comp("Displays a list of all targets, as well as controls for enabling, disabling, launching, editing, or deleting each target. For more information on targets, read the `Targets` section."), str8_lit_comp("Targets"), str8_lit_comp(""), RD_IconKind_Target, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(targets)},
|
||||
{str8_lit_comp("file_path_map"), str8_lit_comp("Displays a table of *path maps*. Each path map is a pair of file or folder paths, one being a 'source' path, and one being a 'destination' path. These pairs are used by the debugger when automatically searching for specific files - for instance, when attempting to snap to a source code location specified by debug info. If debug info refers to a path on the machine on which a target executable was originally built, but that path is not valid on the debugger machine, but some alternative path exists, then path maps may be used to redirect the debugger from the debug info's specified paths to the associated appropriate debugger machine file paths."), str8_lit_comp("File Path Map"), str8_lit_comp(""), RD_IconKind_FileOutline, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(file_path_map)},
|
||||
{str8_lit_comp("auto_view_rules"), str8_lit_comp("Displays a table of *auto view rules*. Each *auto view rule* is a pair, with one element being a type, and the other being a view rule, which should be automatically applied to expressions of that type, when possible."), str8_lit_comp("Auto View Rules"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(auto_view_rules)},
|
||||
{str8_lit_comp("breakpoints"), str8_lit_comp("Displays a table of all breakpoints, containing information about each breakpoint's name, location, and hit count. Also contains per-breakpoint controls for enabling, deleting, or editing each breakpoint. For more information on breakpoints and their features, read the 'Breakpoints' section."), str8_lit_comp("Breakpoints"), str8_lit_comp(""), RD_IconKind_CircleFilled, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(breakpoints)},
|
||||
{str8_lit_comp("watch_pins"), str8_lit_comp("Displays a table of all watch pins (watched expressions, like those found in `Watch`, but instead of being within a table, being pinned to some source code location, like breakpoints). This table contains each pin's name, location, and controls for editing or deleting each pin."), str8_lit_comp("Watch Pins"), str8_lit_comp(""), RD_IconKind_Pin, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(watch_pins)},
|
||||
{str8_lit_comp("scheduler"), str8_lit_comp("Displays all processes and threads to which the debugger is currently attached, and contains controls for selecting and freezing threads."), str8_lit_comp("Scheduler"), str8_lit_comp(""), RD_IconKind_Scheduler, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(scheduler)},
|
||||
{str8_lit_comp("call_stack"), str8_lit_comp("Displays the call stack of the currently selected thread. Each frame in the call stack contains the associated module, function name, and return address. Allows selection of a particular call stack frame other than the top."), str8_lit_comp("Call Stack"), str8_lit_comp(""), RD_IconKind_Thread, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(call_stack)},
|
||||
{str8_lit_comp("modules"), str8_lit_comp("Displays a table of all modules currently loaded by any process to which the debugger is attached. This table displays each module's name, virtual address range in the containing process' address space, and which debug info file is being used by the debugger for the associated module."), str8_lit_comp("Modules"), str8_lit_comp(""), RD_IconKind_Module, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(modules)},
|
||||
{str8_lit_comp("text"), str8_lit_comp(""), str8_lit_comp("Text"), str8_lit_comp("x:{'lang':lang, 'size':expr}"), RD_IconKind_FileOutline, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(text) , RD_VIEW_RULE_UI_FUNCTION_NAME(text)},
|
||||
{str8_lit_comp("disasm"), str8_lit_comp("Displays disassembled instructions in a textual form from the selected thread's containing process virtual address space."), str8_lit_comp("Disassembly"), str8_lit_comp("x:{'arch':arch, 'size':expr, 'addresses':bool, 'code_bytes':bool}"), RD_IconKind_Glasses, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(disasm) , RD_VIEW_RULE_UI_FUNCTION_NAME(disasm)},
|
||||
{str8_lit_comp("output"), str8_lit_comp("Displays debug strings, output from attached processes."), str8_lit_comp("Output"), str8_lit_comp(""), RD_IconKind_List, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(output)},
|
||||
{str8_lit_comp("memory"), str8_lit_comp("A hex-editor-like grid interface for viewing memory."), str8_lit_comp("Memory"), str8_lit_comp("x:{'size':expr}"), RD_IconKind_Grid, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(memory) , RD_VIEW_RULE_UI_FUNCTION_NAME(memory)},
|
||||
{str8_lit_comp("bitmap"), str8_lit_comp("Visualizes memory as a bitmap."), str8_lit_comp("Bitmap"), str8_lit_comp("x:{'w':expr, 'h':expr, 'fmt':tex2dformat}"), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(bitmap) , RD_VIEW_RULE_UI_FUNCTION_NAME(bitmap)},
|
||||
{str8_lit_comp("checkbox"), str8_lit_comp("Visualizes memory as an RGBA color."), str8_lit_comp("Checkbox"), str8_lit_comp(""), RD_IconKind_CheckFilled, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*1|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(checkbox)},
|
||||
|
||||
@@ -392,23 +392,8 @@ RD_ViewRuleKind_GettingStarted,
|
||||
RD_ViewRuleKind_Settings,
|
||||
RD_ViewRuleKind_PendingFile,
|
||||
RD_ViewRuleKind_Watch,
|
||||
RD_ViewRuleKind_Locals,
|
||||
RD_ViewRuleKind_Registers,
|
||||
RD_ViewRuleKind_Globals,
|
||||
RD_ViewRuleKind_ThreadLocals,
|
||||
RD_ViewRuleKind_Types,
|
||||
RD_ViewRuleKind_Procedures,
|
||||
RD_ViewRuleKind_Targets,
|
||||
RD_ViewRuleKind_FilePathMap,
|
||||
RD_ViewRuleKind_AutoViewRules,
|
||||
RD_ViewRuleKind_Breakpoints,
|
||||
RD_ViewRuleKind_WatchPins,
|
||||
RD_ViewRuleKind_Scheduler,
|
||||
RD_ViewRuleKind_CallStack,
|
||||
RD_ViewRuleKind_Modules,
|
||||
RD_ViewRuleKind_Text,
|
||||
RD_ViewRuleKind_Disasm,
|
||||
RD_ViewRuleKind_Output,
|
||||
RD_ViewRuleKind_Memory,
|
||||
RD_ViewRuleKind_Bitmap,
|
||||
RD_ViewRuleKind_Checkbox,
|
||||
@@ -663,23 +648,8 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(getting_started);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(settings);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(pending_file);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(watch);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(locals);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(registers);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(globals);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(thread_locals);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(types);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(procedures);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(targets);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(file_path_map);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(auto_view_rules);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(breakpoints);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(watch_pins);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(scheduler);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(call_stack);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(modules);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(text);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(disasm);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(output);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(memory);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(bitmap);
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(checkbox);
|
||||
@@ -701,7 +671,7 @@ extern RD_StringBindingPair rd_default_binding_table[111];
|
||||
extern String8 rd_binding_version_remap_old_name_table[8];
|
||||
extern String8 rd_binding_version_remap_new_name_table[8];
|
||||
extern String8 rd_icon_kind_text_table[69];
|
||||
extern RD_ViewRuleInfo rd_view_rule_kind_info_table[28];
|
||||
extern RD_ViewRuleInfo rd_view_rule_kind_info_table[13];
|
||||
extern RD_IconKind rd_entity_kind_icon_kind_table[27];
|
||||
extern String8 rd_theme_preset_display_string_table[9];
|
||||
extern String8 rd_theme_preset_code_string_table[9];
|
||||
|
||||
+1
-20
@@ -1031,31 +1031,12 @@ RD_ViewRuleTable:
|
||||
//- rjf: temporary view for loading files - must analyze file before picking viewer
|
||||
{ PendingFile pending_file "Pending File" "" FileOutline 0 0 0 0 0 0 0 "" }
|
||||
|
||||
//- rjf: watch or watch-style tables
|
||||
//- rjf: watch view
|
||||
{ Watch watch "Watch" "" Binoculars 1 1 1 0 0 0 1 "The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section." }
|
||||
{ Locals locals "Locals" "" Binoculars 1 1 1 0 0 0 1 "Nearly identical to `Watch`, but automatically filled with local variables found within the selected call stack frame of the selected thread, according to the associated debug info. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ Registers registers "Registers" "" Binoculars 1 1 1 0 0 0 1 "Nearly identical to `Watch`, but automatically filled with all register names according to the selected thread's architecture. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ Globals globals "Globals" "" Binoculars 1 1 1 0 0 0 1 "Nearly identical to `Watch`, but automatically filled with all global variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ ThreadLocals thread_locals "Thread Locals" "" Binoculars 1 1 1 0 0 0 1 "Nearly identical to `Watch`, but automatically filled with all thread local variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ Types types "Types" "" Binoculars 1 1 1 0 0 0 1 "Nearly identical to `Watch`, but automatically filled with all types within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ Procedures procedures "Procedures" "" Binoculars 1 1 1 0 0 0 1 "Nearly identical to `Watch`, but automatically filled with all procedures within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
|
||||
//- rjf: configuration watch tables
|
||||
{ Targets targets "Targets" "" Target 1 1 1 0 0 0 1 "Displays a list of all targets, as well as controls for enabling, disabling, launching, editing, or deleting each target. For more information on targets, read the `Targets` section." }
|
||||
{ FilePathMap file_path_map "File Path Map" "" FileOutline 1 1 1 0 0 0 1 "Displays a table of *path maps*. Each path map is a pair of file or folder paths, one being a 'source' path, and one being a 'destination' path. These pairs are used by the debugger when automatically searching for specific files - for instance, when attempting to snap to a source code location specified by debug info. If debug info refers to a path on the machine on which a target executable was originally built, but that path is not valid on the debugger machine, but some alternative path exists, then path maps may be used to redirect the debugger from the debug info's specified paths to the associated appropriate debugger machine file paths." }
|
||||
{ AutoViewRules auto_view_rules "Auto View Rules" "" Binoculars 1 1 1 0 0 0 1 "Displays a table of *auto view rules*. Each *auto view rule* is a pair, with one element being a type, and the other being a view rule, which should be automatically applied to expressions of that type, when possible." }
|
||||
{ Breakpoints breakpoints "Breakpoints" "" CircleFilled 1 1 1 0 0 0 1 "Displays a table of all breakpoints, containing information about each breakpoint's name, location, and hit count. Also contains per-breakpoint controls for enabling, deleting, or editing each breakpoint. For more information on breakpoints and their features, read the 'Breakpoints' section." }
|
||||
{ WatchPins watch_pins "Watch Pins" "" Pin 1 1 1 0 0 0 1 "Displays a table of all watch pins (watched expressions, like those found in `Watch`, but instead of being within a table, being pinned to some source code location, like breakpoints). This table contains each pin's name, location, and controls for editing or deleting each pin." }
|
||||
|
||||
//- rjf: debug entity info watch tables
|
||||
{ Scheduler scheduler "Scheduler" "" Scheduler 1 1 1 0 0 0 1 "Displays all processes and threads to which the debugger is currently attached, and contains controls for selecting and freezing threads." }
|
||||
{ CallStack call_stack "Call Stack" "" Thread 1 1 1 0 0 0 1 "Displays the call stack of the currently selected thread. Each frame in the call stack contains the associated module, function name, and return address. Allows selection of a particular call stack frame other than the top." }
|
||||
{ Modules modules "Modules" "" Module 1 1 1 0 0 0 1 "Displays a table of all modules currently loaded by any process to which the debugger is attached. This table displays each module's name, virtual address range in the containing process' address space, and which debug info file is being used by the debugger for the associated module." }
|
||||
|
||||
//- rjf: data visualizers
|
||||
{ Text text "Text" "x:{'lang':lang, 'size':expr}" FileOutline 0 0 0 1 0 1 0 "" }
|
||||
{ Disasm disasm "Disassembly" "x:{'arch':arch, 'size':expr, 'addresses':bool, 'code_bytes':bool}" Glasses 0 0 0 1 0 1 1 "Displays disassembled instructions in a textual form from the selected thread's containing process virtual address space." }
|
||||
{ Output output "Output" "" List 0 0 0 0 0 0 1 "Displays debug strings, output from attached processes." }
|
||||
{ Memory memory "Memory" "x:{'size':expr}" Grid 0 0 0 1 0 1 1 "A hex-editor-like grid interface for viewing memory." }
|
||||
{ Bitmap bitmap "Bitmap" "x:{'w':expr, 'h':expr, 'fmt':tex2dformat}" Binoculars 0 0 0 1 0 1 1 "Visualizes memory as a bitmap." }
|
||||
{ Checkbox checkbox "Checkbox" "" CheckFilled 0 0 0 1 1 0 1 "Visualizes memory as an RGBA color." }
|
||||
|
||||
+35
-13
@@ -8607,7 +8607,7 @@ rd_window_frame(void)
|
||||
Rng2F32 rect = b->rect;
|
||||
if(b->flags & UI_BoxFlag_Floating)
|
||||
{
|
||||
rect = pad_2f32(rect, 2.f);
|
||||
rect = pad_2f32(rect, 1.f);
|
||||
rect = intersect_2f32(window_rect, rect);
|
||||
}
|
||||
Vec4F32 color = rd_rgba_from_theme_color(RD_ThemeColor_Focus);
|
||||
@@ -14476,7 +14476,7 @@ rd_frame(void)
|
||||
|
||||
//- rjf: define all of the "fixed" tabs we care about
|
||||
#define FixedTab_XList \
|
||||
X(watch)\
|
||||
X(watches)\
|
||||
X(locals)\
|
||||
X(registers)\
|
||||
X(globals)\
|
||||
@@ -14486,16 +14486,20 @@ X(procedures)\
|
||||
X(call_stack)\
|
||||
X(breakpoints)\
|
||||
X(watch_pins)\
|
||||
X(output)\
|
||||
X(targets)\
|
||||
X(scheduler)\
|
||||
X(modules)\
|
||||
X(disasm)\
|
||||
X(memory)\
|
||||
X(getting_started)
|
||||
Y(output, text, "query:output_log")\
|
||||
Y(disasm, disasm, "")\
|
||||
Y(memory, memory, "")\
|
||||
Z(getting_started)
|
||||
#define X(name) RD_Cfg *name = &rd_nil_cfg;
|
||||
#define Y(name, rule, expr) RD_Cfg *name = &rd_nil_cfg;
|
||||
#define Z(name) RD_Cfg *name = &rd_nil_cfg;
|
||||
FixedTab_XList
|
||||
#undef X
|
||||
#undef Y
|
||||
#undef Z
|
||||
|
||||
//- rjf: find all the fixed tabs, and all text viewers
|
||||
RD_CfgList texts = {0};
|
||||
@@ -14508,9 +14512,13 @@ X(getting_started)
|
||||
RD_Cfg *tab = n->v;
|
||||
B32 need_unhook = 1;
|
||||
if(0){}
|
||||
#define X(name) else if(str8_match(tab->string, str8_lit(#name), 0)) {name = tab;}
|
||||
#define X(name) else if(str8_match(tab->string, str8_lit("watch"), 0) && str8_match(rd_expr_from_cfg(tab), str8_lit("query:" #name), 0)) {name = tab;}
|
||||
#define Y(name, rule, expr) else if(str8_match(tab->string, str8_lit(#rule), 0) && str8_match(rd_expr_from_cfg(tab), str8_lit(expr), 0)) {name = tab;}
|
||||
#define Z(name) else if(str8_match(tab->string, str8_lit(#name), 0)) {name = tab;}
|
||||
FixedTab_XList
|
||||
#undef X
|
||||
#undef Y
|
||||
#undef Z
|
||||
else if(str8_match(tab->string, str8_lit("text"), 0)) {rd_cfg_list_push(scratch.arena, &texts, tab);}
|
||||
else
|
||||
{
|
||||
@@ -14527,14 +14535,22 @@ X(getting_started)
|
||||
rd_cfg_release(panels);
|
||||
|
||||
//- rjf: allocate any missing tabs
|
||||
#define X(name) if(name == &rd_nil_cfg) {name = rd_cfg_alloc(); rd_cfg_equip_string(name, str8_lit(#name));}
|
||||
#define X(name) if(name == &rd_nil_cfg) {name = rd_cfg_alloc(); rd_cfg_equip_string(name, str8_lit("watch")); RD_Cfg *expr_cfg = rd_cfg_new(name, str8_lit("expression")); rd_cfg_new(expr_cfg, str8_lit("query:" #name));}
|
||||
#define Y(name, rule, expr) if(name == &rd_nil_cfg) {name = rd_cfg_alloc(); rd_cfg_equip_string(name, str8_lit(#rule)); RD_Cfg *expr_cfg = rd_cfg_new(name, str8_lit("expression")); rd_cfg_new(expr_cfg, str8_lit(expr));}
|
||||
#define Z(name) if(name == &rd_nil_cfg) {name = rd_cfg_alloc(); rd_cfg_equip_string(name, str8_lit(#name));}
|
||||
FixedTab_XList
|
||||
#undef X
|
||||
#undef Y
|
||||
#undef Z
|
||||
|
||||
//- rjf: eliminate all tab selections
|
||||
#define X(name) if(name != &rd_nil_cfg) {rd_cfg_release(rd_cfg_child_from_string(name, str8_lit("selected")));}
|
||||
#define Y(name, rule, expr) if(name != &rd_nil_cfg) {rd_cfg_release(rd_cfg_child_from_string(name, str8_lit("selected")));}
|
||||
#define Z(name) if(name != &rd_nil_cfg) {rd_cfg_release(rd_cfg_child_from_string(name, str8_lit("selected")));}
|
||||
FixedTab_XList
|
||||
#undef X
|
||||
#undef Y
|
||||
#undef Z
|
||||
for(RD_CfgNode *n = texts.first; n != 0; n = n->next)
|
||||
{
|
||||
rd_cfg_release(rd_cfg_child_from_string(n->v, str8_lit("selected")));
|
||||
@@ -14586,14 +14602,14 @@ X(getting_started)
|
||||
// rjf: root_0_1 split
|
||||
RD_Cfg *root_0_1_0 = rd_cfg_new(root_0_1, str8_lit("0.60"));
|
||||
RD_Cfg *root_0_1_1 = rd_cfg_new(root_0_1, str8_lit("0.40"));
|
||||
rd_cfg_insert_child(root_0_1_0, root_0_1_0->last, watch);
|
||||
rd_cfg_insert_child(root_0_1_0, root_0_1_0->last, watches);
|
||||
rd_cfg_insert_child(root_0_1_0, root_0_1_0->last, locals);
|
||||
rd_cfg_insert_child(root_0_1_0, root_0_1_0->last, registers);
|
||||
rd_cfg_insert_child(root_0_1_0, root_0_1_0->last, globals);
|
||||
rd_cfg_insert_child(root_0_1_0, root_0_1_0->last, thread_locals);
|
||||
rd_cfg_insert_child(root_0_1_0, root_0_1_0->last, types);
|
||||
rd_cfg_insert_child(root_0_1_0, root_0_1_0->last, procedures);
|
||||
rd_cfg_new(watch, str8_lit("selected"));
|
||||
rd_cfg_new(watches, str8_lit("selected"));
|
||||
rd_cfg_new(root_0_1_0, str8_lit("tabs_on_bottom"));
|
||||
rd_cfg_insert_child(root_0_1_1, root_0_1_1->last, call_stack);
|
||||
rd_cfg_insert_child(root_0_1_1, root_0_1_1->last, modules);
|
||||
@@ -14633,9 +14649,9 @@ X(getting_started)
|
||||
RD_Cfg *root_0_1 = rd_cfg_new(root_0, str8_lit("0.25"));
|
||||
RD_Cfg *root_0_2 = rd_cfg_new(root_0, str8_lit("0.25"));
|
||||
RD_Cfg *root_0_3 = rd_cfg_new(root_0, str8_lit("0.25"));
|
||||
rd_cfg_insert_child(root_0_0, root_0_0->last, watch);
|
||||
rd_cfg_insert_child(root_0_0, root_0_0->last, watches);
|
||||
rd_cfg_insert_child(root_0_0, root_0_0->last, types);
|
||||
rd_cfg_new(watch, str8_lit("selected"));
|
||||
rd_cfg_new(watches, str8_lit("selected"));
|
||||
rd_cfg_insert_child(root_0_1, root_0_1->last, scheduler);
|
||||
rd_cfg_insert_child(root_0_1, root_0_1->last, targets);
|
||||
rd_cfg_insert_child(root_0_1, root_0_1->last, breakpoints);
|
||||
@@ -14671,8 +14687,12 @@ X(getting_started)
|
||||
|
||||
//- rjf: release any unused views from the previous layout
|
||||
#define X(name) if(name->parent == &rd_nil_cfg) {rd_cfg_release(name);}
|
||||
#define Y(name, rule, expr) if(name->parent == &rd_nil_cfg) {rd_cfg_release(name);}
|
||||
#define Z(name) if(name->parent == &rd_nil_cfg) {rd_cfg_release(name);}
|
||||
FixedTab_XList
|
||||
#undef X
|
||||
#undef Y
|
||||
#undef Z
|
||||
}break;
|
||||
|
||||
//- rjf: thread finding
|
||||
@@ -15007,7 +15027,9 @@ X(getting_started)
|
||||
RD_Cfg *tab = tab_n->v;
|
||||
if(rd_cfg_is_project_filtered(tab)) { continue; }
|
||||
RD_ViewRuleKind view_kind = rd_view_rule_kind_from_string(tab->string);
|
||||
if(view_kind == RD_ViewRuleKind_Text && panel_area > best_panel_area)
|
||||
String8 view_expr = rd_expr_from_cfg(tab);
|
||||
String8 file_path = rd_file_path_from_eval_string(scratch.arena, view_expr);
|
||||
if(view_kind == RD_ViewRuleKind_Text && file_path.size != 0 && panel_area > best_panel_area)
|
||||
{
|
||||
panel_w_any_src_code = panel;
|
||||
best_panel_area = panel_area;
|
||||
|
||||
+36
-364
@@ -1494,7 +1494,7 @@ rd_watch_view_init(RD_WatchViewState *ewv)
|
||||
}
|
||||
|
||||
internal void
|
||||
rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view_rule, B32 modifiable, U32 default_radix, Rng2F32 rect)
|
||||
rd_watch_view_build(RD_WatchViewState *ewv, Rng2F32 rect)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
@@ -1505,11 +1505,34 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
||||
//- rjf: unpack arguments
|
||||
//
|
||||
EV_View *eval_view = rd_view_eval_view();
|
||||
String8 filter = rd_view_filter();
|
||||
F32 row_height_px = floor_f32(ui_top_font_size()*2.5f);
|
||||
S64 num_possible_visible_rows = (S64)(dim_2f32(rect).y/row_height_px);
|
||||
F32 row_string_max_size_px = dim_2f32(rect).x;
|
||||
EV_StringFlags string_flags = 0;
|
||||
String8 filter = rd_view_filter();
|
||||
String8 expr = rd_view_expr_string();
|
||||
if(expr.size == 0)
|
||||
{
|
||||
expr = str8_lit("query:watches");
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: decide if root should be implicit
|
||||
//
|
||||
// "implicit" means -> root is automatically expanded, row depth is 1 less than the
|
||||
// block tree structure would suggest. this would be used if the root is, for instance,
|
||||
// the "collection of all watches", to build a watch window. but this behavior is not
|
||||
// as desirable if we are just using some other expression as the root.
|
||||
//
|
||||
B32 implicit_root = 0;
|
||||
{
|
||||
E_Eval eval = e_eval_from_string(scratch.arena, expr);
|
||||
E_TypeKind kind = e_type_kind_from_key(eval.type_key);
|
||||
if(kind == E_TypeKind_Set)
|
||||
{
|
||||
implicit_root = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: determine autocompletion string
|
||||
@@ -1550,8 +1573,11 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
||||
{
|
||||
MemoryZeroStruct(&block_tree);
|
||||
MemoryZeroStruct(&block_ranges);
|
||||
ev_key_set_expansion(eval_view, ev_key_root(), ev_key_make(ev_hash_from_key(ev_key_root()), 1), 1);
|
||||
block_tree = ev_block_tree_from_string(scratch.arena, eval_view, filter, root_expr);
|
||||
if(implicit_root)
|
||||
{
|
||||
ev_key_set_expansion(eval_view, ev_key_root(), ev_key_make(ev_hash_from_key(ev_key_root()), 1), 1);
|
||||
}
|
||||
block_tree = ev_block_tree_from_string(scratch.arena, eval_view, filter, expr);
|
||||
block_ranges = ev_block_range_list_from_tree(scratch.arena, &block_tree);
|
||||
}
|
||||
|
||||
@@ -2428,7 +2454,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
||||
B32 next_row_expanded = row_expanded;
|
||||
RD_WatchRowInfo row_info = rd_watch_row_info_from_row(scratch.arena, row);
|
||||
B32 row_is_expandable = ev_row_is_expandable(row);
|
||||
if(row_depth > 0)
|
||||
if(implicit_root && row_depth > 0)
|
||||
{
|
||||
row_depth -= 1;
|
||||
}
|
||||
@@ -3944,7 +3970,10 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
||||
//
|
||||
if(next_row_expanded != row_expanded)
|
||||
{
|
||||
ev_key_set_expansion(eval_view, row->block->key, row->key, next_row_expanded);
|
||||
if(!ev_key_match(ev_key_root(), row->key) || !implicit_root)
|
||||
{
|
||||
ev_key_set_expansion(eval_view, row->block->key, row->key, next_row_expanded);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4123,144 +4152,6 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(getting_started)
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: targets @view_hook_impl
|
||||
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(targets)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||
if(!wv->initialized)
|
||||
{
|
||||
rd_watch_view_init(wv);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.75f, .dequote_string = 1, .is_non_code = 0);
|
||||
}
|
||||
rd_watch_view_build(wv, str8_lit("collection:targets"), str8_zero(), 1, 10, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: file_path_map @view_hook_impl
|
||||
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(file_path_map)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||
if(!wv->initialized)
|
||||
{
|
||||
rd_watch_view_init(wv);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.75f, .dequote_string = 1, .is_non_code = 0);
|
||||
}
|
||||
rd_watch_view_build(wv, str8_lit("collection:file_path_maps"), str8_zero(), 1, 10, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: auto_view_rules @view_hook_impl
|
||||
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(auto_view_rules)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||
if(!wv->initialized)
|
||||
{
|
||||
rd_watch_view_init(wv);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.75f, .dequote_string = 1, .is_non_code = 0);
|
||||
}
|
||||
rd_watch_view_build(wv, str8_lit("collection:auto_view_rules"), str8_zero(), 1, 10, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: breakpoints @view_hook_impl
|
||||
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(breakpoints)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||
if(!wv->initialized)
|
||||
{
|
||||
rd_watch_view_init(wv);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.75f, .dequote_string = 1);
|
||||
}
|
||||
rd_watch_view_build(wv, str8_lit("collection:breakpoints"), str8_zero(), 0, 10, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: watch_pins @view_hook_impl
|
||||
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(watch_pins)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||
if(!wv->initialized)
|
||||
{
|
||||
rd_watch_view_init(wv);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.75f, .dequote_string = 1);
|
||||
}
|
||||
rd_watch_view_build(wv, str8_lit("collection:watch_pins"), str8_zero(), 0, 10, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: scheduler @view_hook_impl
|
||||
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(scheduler)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||
if(!wv->initialized)
|
||||
{
|
||||
rd_watch_view_init(wv);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.75f, .dequote_string = 1);
|
||||
}
|
||||
rd_watch_view_build(wv, str8_lit("collection:machines"), str8_lit("only: label str id callstack v count vaddr inline_depth"), 0, 10, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: call_stack @view_hook_impl
|
||||
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(call_stack)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||
if(!wv->initialized)
|
||||
{
|
||||
rd_watch_view_init(wv);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_CallStackFrameSelection, 0.05f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_CallStackFrame, 0.50f, .display_string = str8_lit("Symbol"), .dequote_string = 1);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.20f, .string = str8_lit("vaddr"), .display_string = str8_lit("Address"), .view_rule = str8_lit("cast:U64"));
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Module, 0.25f, .string = str8_lit("module.str"), .display_string = str8_lit("Module"), .dequote_string = 1, .is_non_code = 1);
|
||||
}
|
||||
rd_watch_view_build(wv, str8_lit("thread:current_thread.callstack.v"), str8_lit("array:'thread:current_thread.callstack.count', hex"), 0, 10, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: modules @view_hook_impl
|
||||
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(modules)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||
if(!wv->initialized)
|
||||
{
|
||||
rd_watch_view_init(wv);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.75f, .dequote_string = 1);
|
||||
}
|
||||
rd_watch_view_build(wv, str8_lit("collection:modules"), str8_lit("only: exe dbg str vaddr_range min max"), 0, 16, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: watch @view_hook_impl
|
||||
|
||||
@@ -4276,125 +4167,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(watch)
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_ViewRule, 0.30f);
|
||||
}
|
||||
String8 expr = rd_view_expr_string();
|
||||
if(expr.size == 0)
|
||||
{
|
||||
expr = str8_lit("collection:watches");
|
||||
}
|
||||
rd_watch_view_build(wv, expr, str8_lit(""), 1, 10, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: locals @view_hook_impl
|
||||
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(locals)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||
if(!wv->initialized)
|
||||
{
|
||||
rd_watch_view_init(wv);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_ViewRule, 0.30f);
|
||||
}
|
||||
rd_watch_view_build(wv, str8_lit("collection:locals"), str8_lit(""), 0, 10, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: registers @view_hook_impl
|
||||
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(registers)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||
if(!wv->initialized)
|
||||
{
|
||||
rd_watch_view_init(wv);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_ViewRule, 0.30f);
|
||||
}
|
||||
rd_watch_view_build(wv, str8_lit("collection:registers"), str8_lit("hex"), 0, 16, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: globals @view_hook_impl
|
||||
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(globals)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||
if(!wv->initialized)
|
||||
{
|
||||
rd_watch_view_init(wv);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_ViewRule, 0.30f);
|
||||
}
|
||||
rd_watch_view_build(wv, str8_lit("collection:globals"), str8_lit(""), 0, 10, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: thread_locals @view_hook_impl
|
||||
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(thread_locals)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||
if(!wv->initialized)
|
||||
{
|
||||
rd_watch_view_init(wv);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_ViewRule, 0.30f);
|
||||
}
|
||||
rd_watch_view_build(wv, str8_lit("collection:thread_locals"), str8_lit(""), 0, 10, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: types @view_hook_impl
|
||||
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(types)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||
if(!wv->initialized)
|
||||
{
|
||||
rd_watch_view_init(wv);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_ViewRule, 0.30f);
|
||||
}
|
||||
rd_watch_view_build(wv, str8_lit("collection:types"), str8_lit(""), 0, 10, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: procedures @view_hook_impl
|
||||
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(procedures)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||
if(!wv->initialized)
|
||||
{
|
||||
rd_watch_view_init(wv);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.2f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.6f);
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_ViewRule, 0.2f);
|
||||
}
|
||||
rd_watch_view_build(wv, str8_lit("collection:procedures"), str8_lit(""), 0, 10, rect);
|
||||
rd_watch_view_build(wv, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
@@ -5001,107 +4774,6 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(disasm)
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: output @view_hook_impl
|
||||
|
||||
typedef struct RD_OutputViewState RD_OutputViewState;
|
||||
struct RD_OutputViewState
|
||||
{
|
||||
U128 last_hash;
|
||||
RD_CodeViewState cv;
|
||||
};
|
||||
|
||||
RD_VIEW_RULE_UI_FUNCTION_DEF(output)
|
||||
{
|
||||
RD_OutputViewState *ov = rd_view_state(RD_OutputViewState);
|
||||
RD_CodeViewState *cv = &ov->cv;
|
||||
rd_code_view_init(cv);
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
HS_Scope *hs_scope = hs_scope_open();
|
||||
TXT_Scope *txt_scope = txt_scope_open();
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: set up invariants
|
||||
//
|
||||
F32 bottom_bar_height = ui_top_font_size()*2.f;
|
||||
Rng2F32 code_area_rect = r2f32p(rect.x0, rect.y0, rect.x1, rect.y1 - bottom_bar_height);
|
||||
Rng2F32 bottom_bar_rect = r2f32p(rect.x0, rect.y1 - bottom_bar_height, rect.x1, rect.y1);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: unpack parameterization info
|
||||
//
|
||||
rd_regs()->file_path = str8_zero();
|
||||
rd_regs()->vaddr = 0;
|
||||
rd_regs()->cursor.line = rd_value_from_params_key(params, str8_lit("cursor_line")).s64;
|
||||
rd_regs()->cursor.column = rd_value_from_params_key(params, str8_lit("cursor_column")).s64;
|
||||
rd_regs()->mark.line = rd_value_from_params_key(params, str8_lit("mark_line")).s64;
|
||||
rd_regs()->mark.column = rd_value_from_params_key(params, str8_lit("mark_column")).s64;
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: unpack text info
|
||||
//
|
||||
U128 key = d_state->output_log_key;
|
||||
TXT_LangKind lang_kind = TXT_LangKind_Null;
|
||||
U128 hash = {0};
|
||||
TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash);
|
||||
String8 data = hs_data_from_hash(hs_scope, hash);
|
||||
Rng1U64 empty_range = {0};
|
||||
if(info.lines_count == 0)
|
||||
{
|
||||
info.lines_count = 1;
|
||||
info.lines_ranges = &empty_range;
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: scroll-to-bottom
|
||||
//
|
||||
if(!u128_match(hash, ov->last_hash))
|
||||
{
|
||||
ov->last_hash = hash;
|
||||
cv->goto_line_num = info.lines_count;
|
||||
cv->contain_cursor= 1;
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: build code contents
|
||||
//
|
||||
{
|
||||
rd_code_view_build(scratch.arena, cv, 0, code_area_rect, data, &info, 0, r1u64(0, 0), di_key_zero());
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: build bottom bar
|
||||
//
|
||||
{
|
||||
ui_set_next_rect(shift_2f32(bottom_bar_rect, scale_2f32(rect.p0, -1.f)));
|
||||
ui_set_next_flags(UI_BoxFlag_DrawBackground);
|
||||
UI_Row
|
||||
UI_TextAlignment(UI_TextAlign_Center)
|
||||
UI_PrefWidth(ui_text_dim(10, 1))
|
||||
UI_FlagsAdd(UI_BoxFlag_DrawTextWeak)
|
||||
RD_Font(RD_FontSlot_Code)
|
||||
{
|
||||
ui_labelf("(Debug String Output)");
|
||||
ui_spacer(ui_em(1.5f, 1));
|
||||
ui_labelf("Line: %I64d, Column: %I64d", rd_regs()->cursor.line, rd_regs()->cursor.column);
|
||||
ui_spacer(ui_pct(1, 0));
|
||||
ui_labelf("(read only)");
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: store params
|
||||
//
|
||||
rd_store_view_param_s64(str8_lit("cursor_line"), rd_regs()->cursor.line);
|
||||
rd_store_view_param_s64(str8_lit("cursor_column"), rd_regs()->cursor.column);
|
||||
rd_store_view_param_s64(str8_lit("mark_line"), rd_regs()->mark.line);
|
||||
rd_store_view_param_s64(str8_lit("mark_column"), rd_regs()->mark.column);
|
||||
|
||||
txt_scope_close(txt_scope);
|
||||
hs_scope_close(hs_scope);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: memory @view_hook_impl
|
||||
|
||||
|
||||
@@ -245,6 +245,6 @@ internal void rd_watch_view_column_release(RD_WatchViewState *wv, RD_WatchViewCo
|
||||
|
||||
//- rjf: watch view main hooks
|
||||
internal void rd_watch_view_init(RD_WatchViewState *ewv);
|
||||
internal void rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view_rule, B32 modifiable, U32 default_radix, Rng2F32 rect);
|
||||
internal void rd_watch_view_build(RD_WatchViewState *ewv, Rng2F32 rect);
|
||||
|
||||
#endif // RADDBG_VIEWS_H
|
||||
|
||||
Reference in New Issue
Block a user