description coverage, char visualization disabling

This commit is contained in:
Ryan Fleury
2025-04-22 16:13:29 -07:00
parent 5bfb5b578a
commit fc728ea4e9
6 changed files with 51 additions and 21 deletions
@@ -1378,7 +1378,11 @@ ev_string_from_simple_typed_eval(Arena *arena, EV_StringParams *params, E_Eval e
case E_TypeKind_UChar32:
{
B32 type_is_unsigned = (E_TypeKind_UChar8 <= type_kind && type_kind <= E_TypeKind_UChar32);
String8 char_str = ev_string_from_ascii_value(arena, eval.value.s64);
String8 char_str = {0};
if(!(params->flags & EV_StringFlag_DisableChars))
{
char_str = ev_string_from_ascii_value(arena, eval.value.s64);
}
if(char_str.size != 0)
{
if(params->flags & EV_StringFlag_ReadOnlyDisplayRules)
@@ -1621,6 +1625,10 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
{
lens_params.flags |= EV_StringFlag_DisableStrings;
}
else if(str8_match(type->name, str8_lit("no_char"), 0))
{
lens_params.flags |= EV_StringFlag_DisableChars;
}
else if(str8_match(type->name, str8_lit("no_addr"), 0))
{
lens_params.flags |= EV_StringFlag_DisableAddresses;
@@ -235,7 +235,8 @@ enum
EV_StringFlag_PrettyNames = (1<<1),
EV_StringFlag_DisableAddresses = (1<<2),
EV_StringFlag_DisableStrings = (1<<3),
EV_StringFlag_DisableStringQuotes = (1<<4),
EV_StringFlag_DisableChars = (1<<4),
EV_StringFlag_DisableStringQuotes = (1<<5),
};
typedef struct EV_StringParams EV_StringParams;
+8 -7
View File
@@ -328,12 +328,12 @@ RD_NameSchemaInfo rd_name_schema_info_table[21] =
{str8_lit_comp("user"), str8_lit_comp("x:\n{\n //- rjf: animations\n @default(1) 'hover_animations': bool,\n @default(1) 'press_animations': bool,\n @default(0) 'focus_animations': bool,\n @default(1) 'tooltip_animations': bool,\n @default(1) 'menu_animations': bool,\n @default(1) 'scrolling_animations': bool,\n\n //- rjf: thread & breakpoint decorations\n @default(1) @display_name('Thread Lines') @description(\"Controls whether or not a long horizontal line is drawn before the next line or instruction that the selected thread will execute in source and disassembly views.\")\n 'thread_lines': bool,\n @default(1) @display_name('Thread Glow') @description(\"Controls whether or not a glowing effect is drawn on the selected thread in source and disassembly views.\")\n 'thread_glow': bool,\n @default(1) @display_name('Breakpoint Lines') @description(\"Controls whether or not a long horizontal line is drawn before the line or instruction at which a breakpoint is placed, in source and disassembly views.\")\n 'breakpoint_lines': bool,\n @default(1) @display_name('Breakpoint Glow') @description(\"Controls whether or not a glowing effect is drawn on breakpoints in source and disassembly views.\")\n 'breakpoint_glow': bool,\n\n //- rjf: occluding background settings\n @default(0) @display_name('Opaque Backgrounds') @description(\"Controls whether or not all floating background colors are forced to be fully opaque.\")\n 'opaque_backgrounds': bool,\n @default(1) @display_name('Background Blur') @description(\"Controls whether or not occluded regions behind floating elements are blurred.\")\n 'background_blur': bool,\n\n //- rjf: appearance settings\n @default(1) @display_name('Drop Shadows') @description(\"Controls whether or not drop shadows are drawn.\")\n 'drop_shadows': bool,\n @default(1.f) @display_name('Rounded Corner Amount') @description(\"Controls the degree to which UI corners are rounded.\")\n 'rounded_corner_amount': @range[0, 1] f32,\n\n //- rjf: code formatting settings\n @default(2) @display_name('User Tab Width') 'tab_width': @range[1, 32] u64,\n\n //- rjf: windows style menu bar\n @default(1) @display_name('Focus Menu Bar With Alt') @description(\"Mimics standard Windows behavior of focusing the menu bar using the Alt key.\")\n 'focus_menu_bar_with_alt': bool,\n}\n")},
{str8_lit_comp("project"), str8_lit_comp("x:\n{\n @default(2) @display_name('Project Tab Width') 'tab_width': @range[1, 32] u64,\n}\n")},
{str8_lit_comp("window"), str8_lit_comp("x:\n{\n //- rjf: text rasterization settings\n @default(1) @display_name('Smooth UI Text') @description(\"Controls whether or not UI text is fully anti-aliased, for a smoother appearance.\")\n 'smooth_ui_text': bool,\n @default(1) @display_name('Hint UI Text') @description(\"Controls whether or not UI text is hinted, for better text readability at small sizes.\")\n 'hint_ui_text': bool,\n @default(0) @display_name('Smooth Code Text') @description(\"Controls whether or not code text is fully anti-aliased, for a smoother appearance.\")\n 'smooth_code_text': bool,\n @default(1) @display_name('Hint Code Text') @description(\"Controls whether or not code text is hinted, for better text readability at small sizes.\")\n 'hint_code_text': bool,\n @default(11) @display_name('Window Font Size') @description(\"Controls the window's default font size. Does not apply to tabs with their own font size set.\")\n 'font_size': @range[6, 72] u64,\n\n //- rjf: size settings\n @default(3.f) @display_name('Window Row Height') @description(\"Controls the window's default row height, in multiples of the font size. Does not apply to tabs with their own row height set.\")\n 'row_height': @range[1.75f, 5.f] f32,\n @default(3.f) @description(\"Controls the height of tabs, in multiples of the font size.\")\n 'tab_height': @range[1.75f, 5.f] f32,\n}\n")},
{str8_lit_comp("tab"), str8_lit_comp("x:\n{\n @default(11) @display_name('Tab Font Size') 'font_size': @range[6, 72] u64,\n}\n")},
{str8_lit_comp("watch"), str8_lit_comp("@inherit(tab) x:\n{\n @default(3.f) @display_name('Tab Row Height') 'row_height': @range[1.75f, 5.f] f32,\n}\n")},
{str8_lit_comp("text"), str8_lit_comp("@inherit(tab) x:\n{\n 'lang':lang,\n 'size':code_string,\n @default(1) 'show_line_numbers':bool,\n @default(0) @display_name('Transient') @description(\"Controls whether or not this tab will be automatically replaced by the debugger when it snaps to new source code locations.\")\n 'auto': bool,\n}\n")},
{str8_lit_comp("disasm"), str8_lit_comp("@inherit(tab) x:\n{\n 'arch': arch,\n 'syntax': dasm_syntax,\n 'size': code_string,\n @default(1) @description(\"Controls whether or not addresses are shown in the disassembly text.\")\n 'show_addresses': bool,\n @default(0) @description(\"Controls whether or not code bytes are shown in the disassembly text.\")\n 'show_code_bytes': bool,\n @default(1) @description(\"Controls whether or not source lines, corresponding to disassembly instruction ranges, are shown in the disassembly text.\")\n 'show_source_lines': bool,\n @default(1) @description(\"Controls whether or not disassembly text is decorated with symbol names.\")\n 'show_symbol_names': bool,\n @default(1) 'show_line_numbers': bool,\n}\n")},
{str8_lit_comp("memory"), str8_lit_comp("@inherit(tab) x:\n{\n 'size': code_string,\n @default(16) 'num_columns': @range[1, 64] u64,\n @default(1) 'bytes_per_cell': @range[1, 8] u64,\n}\n")},
{str8_lit_comp("bitmap"), str8_lit_comp("@inherit(tab) x:\n{\n @order(0) 'w': u64,\n @order(1) 'h': u64,\n 'fmt': tex2dformat,\n}\n")},
{str8_lit_comp("tab"), str8_lit_comp("x:\n{\n @default(11) @display_name('Tab Font Size') @description(\"Controls the tab's font size.\")\n 'font_size': @range[6, 72] u64,\n}\n")},
{str8_lit_comp("watch"), str8_lit_comp("@inherit(tab) x:\n{\n @default(3.f) @display_name('Tab Row Height') @description(\"Controls the tab's row height, in multiples of the font size.\")\n 'row_height': @range[1.75f, 5.f] f32,\n}\n")},
{str8_lit_comp("text"), str8_lit_comp("@inherit(tab) x:\n{\n @description(\"The language that the text should be interpreted as being within. Used for syntax highlighting and other parsing features.\")\n 'lang': lang,\n @default(1) @description(\"Controls whether or not line numbers are shown.\")\n 'show_line_numbers':bool,\n @default(0) @display_name('Transient') @description(\"Controls whether or not this tab will be automatically replaced by the debugger when it snaps to new source code locations.\")\n 'auto': bool,\n}\n")},
{str8_lit_comp("disasm"), str8_lit_comp("@inherit(tab) x:\n{\n 'arch': arch,\n 'syntax': dasm_syntax,\n 'size': code_string,\n @default(1) @description(\"Controls whether or not addresses are shown in the disassembly text.\")\n 'show_addresses': bool,\n @default(0) @description(\"Controls whether or not code bytes are shown in the disassembly text.\")\n 'show_code_bytes': bool,\n @default(1) @description(\"Controls whether or not source lines, corresponding to disassembly instruction ranges, are shown in the disassembly text.\")\n 'show_source_lines': bool,\n @default(1) @description(\"Controls whether or not disassembly text is decorated with symbol names.\")\n 'show_symbol_names': bool,\n @default(1) @description(\"Controls whether or not line numbers are shown.\")\n 'show_line_numbers': bool,\n}\n")},
{str8_lit_comp("memory"), str8_lit_comp("@inherit(tab) x:\n{\n @description(\"The number of bytes of the viewed memory range.\")\n 'size': code_string,\n @default(16) @description(\"The number of columns to build before building new rows.\")\n 'num_columns': @range[1, 64] u64,\n @default(1) @description(\"The number of bytes that each cell should represent.\")\n 'bytes_per_cell': @range[1, 8] u64,\n}\n")},
{str8_lit_comp("bitmap"), str8_lit_comp("@inherit(tab) x:\n{\n @order(0) 'w': u64,\n @order(1) 'h': u64,\n @display_name(\"Bitmap Format\") @description(\"The pixel format that the bitmap data should be interpreted as being within.\")\n 'fmt': tex2dformat,\n}\n")},
{str8_lit_comp("geo3d"), str8_lit_comp("@inherit(tab) x:\n{\n 'count': code_string,\n 'vtx': code_string,\n 'vtx_size': code_string,\n 'yaw': @range[0, 1] f32,\n 'pitch': @range[-0.5, 0] f32,\n 'zoom': @range[0, 100] f32,\n}\n")},
{str8_lit_comp("target"), str8_lit_comp("@row_commands(enable_cfg, launch_and_run, launch_and_step_into, duplicate_cfg, remove_cfg)\n@collection_commands(add_target)\nx:\n{\n 'label': code_string,\n 'executable': path,\n 'arguments': string,\n 'working_directory': path,\n 'entry_point': code_string,\n 'stdout_path': path,\n 'stderr_path': path,\n 'stdin_path': path,\n 'environment': query,\n 'debug_subprocesses': bool,\n @no_expand @default(0) 'enabled': bool,\n}\n")},
{str8_lit_comp("breakpoint"), str8_lit_comp("@row_commands(enable_cfg, duplicate_cfg, remove_cfg)\n@collection_commands(toggle_breakpoint, add_breakpoint, add_address_breakpoint)\nx:\n{\n 'label': code_string,\n 'condition': code_string,\n 'source_location': path_pt,\n 'address_location': code_string,\n 'hit_count': u64,\n 'address_range_size': @or(0, 1, 2, 4, 8) u64,\n 'break_on_write': bool,\n 'break_on_read': bool,\n 'break_on_execute': bool,\n @no_expand @default(1) 'enabled': bool,\n}\n")},
@@ -609,7 +609,7 @@ RD_CmdKindInfo rd_cmd_kind_info_table[211] =
{ str8_lit_comp("log_marker"), str8_lit_comp("Logs a marker in the application log, to denote specific points in time within the log."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}},
};
struct {String8 string; RD_Binding binding;} rd_default_binding_table[107] =
struct {String8 string; RD_Binding binding;} rd_default_binding_table[108] =
{
{str8_lit_comp("kill_all"), {OS_Key_F5, 0 |OS_Modifier_Shift }},
{str8_lit_comp("step_into_inst"), {OS_Key_F11, 0 |OS_Modifier_Alt}},
@@ -716,6 +716,7 @@ struct {String8 string; RD_Binding binding;} rd_default_binding_table[107] =
{str8_lit_comp("add_target"), {OS_Key_T, 0 |OS_Modifier_Ctrl }},
{str8_lit_comp("attach"), {OS_Key_F6, 0 |OS_Modifier_Shift }},
{str8_lit_comp("open_palette"), {OS_Key_F1, 0 }},
{str8_lit_comp("open_palette"), {OS_Key_P, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift }},
{str8_lit_comp("log_marker"), {OS_Key_M, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift |OS_Modifier_Alt}},
{str8_lit_comp("toggle_dev_menu"), {OS_Key_D, 0 |OS_Modifier_Ctrl |OS_Modifier_Shift |OS_Modifier_Alt}},
};
+19 -10
View File
@@ -235,7 +235,8 @@ RD_VocabTable:
```
x:
{
@default(11) @display_name('Tab Font Size') 'font_size': @range[6, 72] u64,
@default(11) @display_name('Tab Font Size') @description("Controls the tab's font size.")
'font_size': @range[6, 72] u64,
}
```
}
@@ -246,7 +247,8 @@ RD_VocabTable:
```
@inherit(tab) x:
{
@default(3.f) @display_name('Tab Row Height') 'row_height': @range[1.75f, 5.f] f32,
@default(3.f) @display_name('Tab Row Height') @description("Controls the tab's row height, in multiples of the font size.")
'row_height': @range[1.75f, 5.f] f32,
}
```
}
@@ -255,9 +257,10 @@ RD_VocabTable:
```
@inherit(tab) x:
{
'lang':lang,
'size':code_string,
@default(1) 'show_line_numbers':bool,
@description("The language that the text should be interpreted as being within. Used for syntax highlighting and other parsing features.")
'lang': lang,
@default(1) @description("Controls whether or not line numbers are shown.")
'show_line_numbers':bool,
@default(0) @display_name('Transient') @description("Controls whether or not this tab will be automatically replaced by the debugger when it snaps to new source code locations.")
'auto': bool,
}
@@ -279,7 +282,8 @@ RD_VocabTable:
'show_source_lines': bool,
@default(1) @description("Controls whether or not disassembly text is decorated with symbol names.")
'show_symbol_names': bool,
@default(1) 'show_line_numbers': bool,
@default(1) @description("Controls whether or not line numbers are shown.")
'show_line_numbers': bool,
}
```
}
@@ -288,9 +292,12 @@ RD_VocabTable:
```
@inherit(tab) x:
{
'size': code_string,
@default(16) 'num_columns': @range[1, 64] u64,
@default(1) 'bytes_per_cell': @range[1, 8] u64,
@description("The number of bytes of the viewed memory range.")
'size': code_string,
@default(16) @description("The number of columns to build before building new rows.")
'num_columns': @range[1, 64] u64,
@default(1) @description("The number of bytes that each cell should represent.")
'bytes_per_cell': @range[1, 8] u64,
}
```
}
@@ -301,7 +308,8 @@ RD_VocabTable:
{
@order(0) 'w': u64,
@order(1) 'h': u64,
'fmt': tex2dformat,
@display_name("Bitmap Format") @description("The pixel format that the bitmap data should be interpreted as being within.")
'fmt': tex2dformat,
}
```
}
@@ -980,6 +988,7 @@ RD_DefaultBindingTable:
//- rjf: command lister
{ "open_palette" F1 0 0 0 }
{ "open_palette" P ctrl shift 0 }
//- rjf: developer commands
{ "log_marker" M ctrl shift alt }
+1
View File
@@ -12303,6 +12303,7 @@ rd_frame(void)
{str8_lit("hex"), 1, 1, 0, 0, 0, {0}},
{str8_lit("digits"), 1, 1, 0, 0, 0, {0}},
{str8_lit("no_string"), 1, 1, 0, 0, 0, {0}},
{str8_lit("no_char"), 1, 1, 0, 0, 0, {0}},
{str8_lit("no_addr"), 1, 1, 0, 0, 0, {0}},
{str8_lit("sequence"), 0, 0, 1, 0, 0, {E_TYPE_EXPAND_INFO_FUNCTION_NAME(sequence), E_TYPE_EXPAND_RANGE_FUNCTION_NAME(sequence)}},
{str8_lit("only"), 0, 0, 0, 0, 0, {E_TYPE_EXPAND_INFO_FUNCTION_NAME(only), E_TYPE_EXPAND_RANGE_FUNCTION_NAME(only)}},
+12 -2
View File
@@ -533,8 +533,18 @@ E_TYPE_EXPAND_INFO_FUNCTION_DEF(schema)
{
if(!md_node_has_tag(child, str8_lit("no_expand"), 0))
{
FuzzyMatchRangeList matches = fuzzy_match_find(scratch.arena, filter, child->string);
if(matches.count == matches.needle_part_count)
String8 display_name = md_tag_from_string(child, str8_lit("display_name"), 0)->first->string;
if(display_name.size == 0)
{
display_name = rd_display_from_code_name(child->string);
}
String8 desc = md_tag_from_string(child, str8_lit("description"), 0)->first->string;
FuzzyMatchRangeList name_matches = fuzzy_match_find(scratch.arena, filter, child->string);
FuzzyMatchRangeList display_name_matches = fuzzy_match_find(scratch.arena, filter, display_name);
FuzzyMatchRangeList desc_matches = fuzzy_match_find(scratch.arena, filter, desc);
if(name_matches.count == name_matches.needle_part_count ||
display_name_matches.count == display_name_matches.needle_part_count ||
desc_matches.count == desc_matches.needle_part_count)
{
ExpandChildNode *n = push_array(scratch.arena, ExpandChildNode, 1);
n->n = child;