diff --git a/src/raddbg/generated/raddbg.meta.c b/src/raddbg/generated/raddbg.meta.c index b2f8aab6..ca54b5ae 100644 --- a/src/raddbg/generated/raddbg.meta.c +++ b/src/raddbg/generated/raddbg.meta.c @@ -399,7 +399,7 @@ RD_VocabInfo rd_vocab_info_table[333] = RD_NameSchemaInfo rd_name_schema_info_table[23] = { -{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: fonts\n @display_name('UI Font') @description(\"The name of, or path to, the font used when displaying non-code UI elements.\")\n 'main_font': string,\n @display_name('Code Font') @description(\"The name of, or path to, the font used when displaying code.\")\n 'code_font': string,\n\n //- rjf: theme\n @display_name('Theme Preset') @description(\"The selected built-in theme preset.\")\n 'theme_preset': string,\n @no_expand @display_name('Theme File') @description(\"The path from which theme data is loaded, overriding the preset.\")\n 'theme_file': path,\n @display_name('Theme Colors') @description(\"Additional theme colors which are applied on top of the theme file or preset.\")\n 'theme_colors': query,\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("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: fonts\n @display_name('UI Font') @description(\"The name of, or path to, the font used when displaying non-code UI elements.\")\n 'main_font': string,\n @display_name('Code Font') @description(\"The name of, or path to, the font used when displaying code.\")\n 'code_font': string,\n\n //- rjf: theme\n @display_name('Theme Preset') @description(\"The selected built-in theme preset.\")\n 'theme_preset': string,\n @no_expand @display_name('Theme File') @description(\"The path from which theme data is loaded, overriding the preset.\")\n 'theme_file': path,\n @display_name('Theme Colors') @description(\"Additional theme colors which are applied on top of the theme file or preset.\")\n 'theme_colors': query,\n\n //- rjf: autocompletion\n @display_name('Autocompletion Lister') @description(\"Enables the autocompletion lister while typing expressions.\") @default(1)\n 'autocompletion_lister': 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 //- rjf: theme\n @display_name('Project Theme Preset') @description(\"The selected built-in project theme preset.\")\n 'theme_preset': string,\n @no_expand @display_name('Project Theme File') @description(\"The path from which project's theme data is loaded, overriding the preset.\")\n 'theme_file': path,\n @display_name('Project Theme Colors') @description(\"Additional theme colors which are applied on top of the project's theme file or preset.\")\n 'theme_colors': query,\n\n //- rjf: exception settings\n @default(1) @display_name(\"Break On Win32 Control-C Exceptions\") @description(\"Code: 0x40010005\")\n win32_ctrl_c: bool;\n @default(1) @display_name(\"Break On Win32 Control-Break Exceptions\") @description(\"Code: 0x40010008\")\n win32_ctrl_break: bool;\n @default(0) @display_name(\"Break On Win32 WinRT Originate Error Exceptions\") @description(\"Code: 0x40080201\")\n win32_win_rt_originate_error: bool;\n @default(0) @display_name(\"Break On Win32 WinRT Transform Error Exceptions\") @description(\"Code: 0x40080202\")\n win32_win_rt_transform_error: bool;\n @default(0) @display_name(\"Break On Win32 RPC Call Cancelled Exceptions\") @description(\"Code: 0x0000071a\")\n win32_rpc_call_cancelled: bool;\n @default(0) @display_name(\"Break On Win32 Data Type Misalignment Exceptions\") @description(\"Code: 0x80000002\")\n win32_datatype_misalignment: bool;\n @default(1) @display_name(\"Break On Win32 Access Violation Exceptions\") @description(\"Code: 0xc0000005\")\n win32_access_violation: bool;\n @default(0) @display_name(\"Break On Win32 In Page Error Exceptions\") @description(\"Code: 0xc0000006\")\n win32_in_page_error: bool;\n @default(1) @display_name(\"Break On Win32 Invalid Handle Specified Exceptions\") @description(\"Code: 0xc0000008\")\n win32_invalid_handle: bool;\n @default(0) @display_name(\"Break On Win32 Not Enough Quota Exceptions\") @description(\"Code: 0xc0000017\")\n win32_not_enough_quota: bool;\n @default(0) @display_name(\"Break On Win32 Illegal Instruction Exceptions\") @description(\"Code: 0xc000001d\")\n win32_illegal_instruction: bool;\n @default(0) @display_name(\"Break On Win32 Cannot Continue From Exception Exceptions\") @description(\"Code: 0xc0000025\")\n win32_cannot_continue_exception: bool;\n @default(0) @display_name(\"Break On Win32 Invalid Exception Disposition Returned By Handler Exceptions\") @description(\"Code: 0xc0000026\")\n win32_invalid_exception_disposition: bool;\n @default(0) @display_name(\"Break On Win32 Array Bounds Exceeded Exceptions\") @description(\"Code: 0xc000008c\")\n win32_array_bounds_exceeded: bool;\n @default(0) @display_name(\"Break On Win32 Floating-Point Denormal Operand Exceptions\") @description(\"Code: 0xc000008d\")\n win32_floating_point_denormal_operand: bool;\n @default(0) @display_name(\"Break On Win32 Floating-Point Division By Zero Exceptions\") @description(\"Code: 0xc000008e\")\n win32_floating_point_division_by_zero: bool;\n @default(0) @display_name(\"Break On Win32 Floating-Point Inexact Result Exceptions\") @description(\"Code: 0xc000008f\")\n win32_floating_point_inexact_result: bool;\n @default(0) @display_name(\"Break On Win32 Floating-Point Invalid Operation Exceptions\") @description(\"Code: 0xc0000090\")\n win32_floating_point_invalid_operation: bool;\n @default(0) @display_name(\"Break On Win32 Floating-Point Overflow Exceptions\") @description(\"Code: 0xc0000091\")\n win32_floating_point_overflow: bool;\n @default(0) @display_name(\"Break On Win32 Floating-Point Stack Check Exceptions\") @description(\"Code: 0xc0000092\")\n win32_floating_point_stack_check: bool;\n @default(0) @display_name(\"Break On Win32 Floating-Point Underflow Exceptions\") @description(\"Code: 0xc0000093\")\n win32_floating_point_underflow: bool;\n @default(0) @display_name(\"Break On Win32 Integer Division By Zero Exceptions\") @description(\"Code: 0xc0000094\")\n win32_integer_division_by_zero: bool;\n @default(0) @display_name(\"Break On Win32 Integer Overflow Exceptions\") @description(\"Code: 0xc0000095\")\n win32_integer_overflow: bool;\n @default(0) @display_name(\"Break On Win32 Privileged Instruction Exceptions\") @description(\"Code: 0xc0000096\")\n win32_privileged_instruction: bool;\n @default(0) @display_name(\"Break On Win32 Stack Overflow Exceptions\") @description(\"Code: 0xc00000fd\")\n win32_stack_overflow: bool;\n @default(0) @display_name(\"Break On Win32 Unable To Locate DLL Exceptions\") @description(\"Code: 0xc0000135\")\n win32_unable_to_locate_dll: bool;\n @default(0) @display_name(\"Break On Win32 Ordinal Not Found Exceptions\") @description(\"Code: 0xc0000138\")\n win32_ordinal_not_found: bool;\n @default(0) @display_name(\"Break On Win32 Entry Point Not Found Exceptions\") @description(\"Code: 0xc0000139\")\n win32_entry_point_not_found: bool;\n @default(0) @display_name(\"Break On Win32 DLL Initialization Failed Exceptions\") @description(\"Code: 0xc0000142\")\n win32_dll_initialization_failed: bool;\n @default(0) @display_name(\"Break On Win32 Floating Point SSE Multiple Faults Exceptions\") @description(\"Code: 0xc00002b4\")\n win32_floating_point_sse_multiple_faults: bool;\n @default(0) @display_name(\"Break On Win32 Floating Point SSE Multiple Traps Exceptions\") @description(\"Code: 0xc00002b5\")\n win32_floating_point_sse_multiple_traps: bool;\n @default(1) @display_name(\"Break On Win32 Assertion Failed Exceptions\") @description(\"Code: 0xc0000420\")\n win32_assertion_failed: bool;\n @default(0) @display_name(\"Break On Win32 Module Not Found Exceptions\") @description(\"Code: 0xc06d007e\")\n win32_module_not_found: bool;\n @default(0) @display_name(\"Break On Win32 Procedure Not Found Exceptions\") @description(\"Code: 0xc06d007f\")\n win32_procedure_not_found: bool;\n @default(1) @display_name(\"Break On Win32 Sanitizer Error Detected Exceptions\") @description(\"Code: 0xe073616e\")\n win32_sanitizer_error_detected: bool;\n @default(0) @display_name(\"Break On Win32 Sanitizer Raw Access Violation Exceptions\") @description(\"Code: 0xe0736171\")\n win32_sanitizer_raw_access_violation: bool;\n @default(1) @display_name(\"Break On Win32 DirectX Debug Layer Exceptions\") @description(\"Code: 0x0000087a\")\n win32_directx_debug_layer: bool;\n}\n")}, {str8_lit_comp("theme_color"), str8_lit_comp("@collection_commands(add_theme_color, fork_loaded_theme_colors, save_theme_colors)\n@row_commands(remove_cfg)\nx:\n{\n @display_name('Tags') tags: string,\n @display_name('Value') value: @color @hex u32,\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")}, @@ -407,7 +407,7 @@ RD_NameSchemaInfo rd_name_schema_info_table[23] = {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 'label': code_string,\n @description(\"The root expression which is evaluated to produce the watch window.\")\n 'expression': code_string,\n @no_expand 'watches': query,\n}\n")}, {str8_lit_comp("text"), str8_lit_comp("@inherit(tab) x:\n{\n @description(\"An expression to describe data which should be viewed as text or code.\")\n 'expression': code_string,\n @description(\"The language that the text should be interpreted as being within. Used for syntax highlighting and other parsing features.\")\n 'lang': code_string,\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 @description(\"An expression to describe the base address or offset of the disassembly.\")\n 'expression': code_string,\n 'arch': code_string,\n 'syntax': code_string,\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(\"An expression to describe the base address or offset of the memory view.\")\n 'expression': code_string,\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("memory"), str8_lit_comp("@inherit(tab) x:\n{\n @display_name(\"Base Address\") @description(\"An expression to describe the base address or offset of the memory view.\")\n 'expression': code_string,\n @display_name(\"Address Range Size\") @description(\"The number of bytes of the viewed memory range.\")\n 'size': code_string,\n @display_name(\"Cursor Address\") @description(\"The address of the cursor.\")\n 'cursor': code_string,\n @display_name(\"Cursor Size\") @description(\"The size, in bytes, of the cursor.\")\n 'cursor_size': @range[1, 16] u64,\n @default(16) @description(\"The number of columns to build before building new rows.\")\n 'num_columns': @range[1, 64] u64,\n}\n")}, {str8_lit_comp("bitmap"), str8_lit_comp("@inherit(tab) x:\n{\n @display_name(\"Base Pointer\") @description(\"An expression to describe the base address or offset of the bitmap data.\")\n 'expression': code_string,\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': code_string,\n}\n")}, {str8_lit_comp("color"), str8_lit_comp("@inherit(tab) x:\n{\n @display_name(\"Value\") @description(\"An expression to describe the value or location of the color.\")\n 'expression': code_string,\n}\n")}, {str8_lit_comp("geo3d"), str8_lit_comp("@inherit(tab) x:\n{\n @display_name(\"Expression\") @description(\"An expression to describe the base address of the index buffer.\")\n 'expression': code_string,\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")}, @@ -946,7 +946,7 @@ str8_lit_comp("far_manager"), String8 rd_theme_preset_cfg_string_table[9] = { -str8_lit_comp("theme:\n{\n theme_color: {tags:\"background\", value: 0x1b1b1bff }\n theme_color: {tags:\"alt background\", value: 0x222222ff }\n theme_color: {tags:\"pop background\", value: 0x355b6eff }\n theme_color: {tags:\"fresh background\", value: 0x31393dff }\n theme_color: {tags:\"match background\", value: 0x31393dff }\n theme_color: {tags:\"border\", value: 0x404040ff }\n theme_color: {tags:\"text\", value: 0xe5e5e5ff }\n theme_color: {tags:\"weak text\", value: 0xa4a4a4ff }\n theme_color: {tags:\"good text\", value: 0x32a852ff }\n theme_color: {tags:\"bad text\", value: 0xcf5242ff }\n theme_color: {tags:\"hover\", value: 0xffffffff }\n theme_color: {tags:\"focus\", value: 0xfda200ff }\n theme_color: {tags:\"cursor\", value: 0x8aff00ff }\n theme_color: {tags:\"selection\", value: 0x99ccffff }\n theme_color: {tags:\"inactive background\", value: 0x0000002f }\n theme_color: {tags:\"drop_shadow\", value: 0x0000007f }\n theme_color: {tags:\"good_pop background\", value: 0x2c5b36ff }\n theme_color: {tags:\"good_pop border\", value: 0x568761ff }\n theme_color: {tags:\"good_pop hover\", value: 0xe3f5d3ff }\n theme_color: {tags:\"good_pop weak text\", value: 0xe3f5d3ff }\n theme_color: {tags:\"bad_pop background\", value: 0x803425ff }\n theme_color: {tags:\"bad_pop hover\", value: 0xff825cff }\n theme_color: {tags:\"code_default\", value: 0xcbcbcbff }\n theme_color: {tags:\"code_symbol\", value: 0x42a2cfff }\n theme_color: {tags:\"code_type\", value: 0xfec746ff }\n theme_color: {tags:\"code_local\", value: 0x98bc80ff }\n theme_color: {tags:\"code_register\", value: 0xb7afd5ff }\n theme_color: {tags:\"code_keyword\", value: 0xb38d4cff }\n theme_color: {tags:\"code_delimiter_or_operator\", value: 0x767676ff }\n theme_color: {tags:\"code_numeric\", value: 0x98abb1ff }\n theme_color: {tags:\"code_numeric_alt_digit_group\", value: 0x738287ff }\n theme_color: {tags:\"code_string\", value: 0x98abb1ff }\n theme_color: {tags:\"code_meta\", value: 0xd96759ff }\n theme_color: {tags:\"code_comment\", value: 0x717171ff }\n theme_color: {tags:\"line_info_0\", value: 0x4f3022ff }\n theme_color: {tags:\"line_info_1\", value: 0x4f3e15ff }\n theme_color: {tags:\"line_info_2\", value: 0x434e2aff }\n theme_color: {tags:\"line_info_3\", value: 0x36241fff }\n theme_color: {tags:\"line_info_4\", value: 0x4f3022ff }\n theme_color: {tags:\"line_info_5\", value: 0x4f3e15ff }\n theme_color: {tags:\"line_info_6\", value: 0x434e2aff }\n theme_color: {tags:\"line_info_7\", value: 0x36241fff }\n theme_color: {tags:\"thread_0\", value: 0xffcb7fff }\n theme_color: {tags:\"thread_1\", value: 0xb2ff65ff }\n theme_color: {tags:\"thread_2\", value: 0xff99e5ff }\n theme_color: {tags:\"thread_3\", value: 0x6598ffff }\n theme_color: {tags:\"thread_4\", value: 0x65ffcbff }\n theme_color: {tags:\"thread_5\", value: 0xff9819ff }\n theme_color: {tags:\"thread_6\", value: 0x9932ffff }\n theme_color: {tags:\"thread_7\", value: 0x65ff4cff }\n theme_color: {tags:\"thread_unwound\", value: 0xb2ccd8ff }\n theme_color: {tags:\"thread_error\", value: 0xb23219ff }\n theme_color: {tags:\"breakpoint\", value: 0xa72911ff }\n theme_color: {tags:\"floating background\", value: 0x1b1b1baf }\n theme_color: {tags:\"floating background alt\", value: 0x0000005f }\n theme_color: {tags:\"floating background fresh\", value: 0x31393d5f }\n theme_color: {tags:\"floating border\", value: 0xbfbfbf1f }\n theme_color: {tags:\"floating scroll_bar background\", value: 0x3b3b3b5f }\n theme_color: {tags:\"floating scroll_bar border\", value: 0x5f5f5f5f }\n theme_color: {tags:\"menu_bar background\", value: 0x2b3740ff }\n theme_color: {tags:\"menu_bar border\", value: 0x3e4c57ff }\n theme_color: {tags:\"scroll_bar background\", value: 0x2b2b2bff }\n theme_color: {tags:\"scroll_bar border\", value: 0x3f3f3fff }\n theme_color: {tags:\"implicit background\", value: 0x00000000 }\n theme_color: {tags:\"implicit border\", value: 0x00000000 }\n theme_color: {tags:\"hollow background\", value: 0x00000000 }\n theme_color: {tags:\"hollow border\", value: 0xffffff1f }\n theme_color: {tags:\"tab background\", value: 0x6f5135ff }\n theme_color: {tags:\"tab border\", value: 0x8a6e54ff }\n theme_color: {tags:\"tab inactive background\", value: 0x2b3740ff }\n theme_color: {tags:\"tab inactive border\", value: 0x3e4c57ff }\n theme_color: {tags:\"tab auto background\", value: 0x693847ff }\n theme_color: {tags:\"tab auto border\", value: 0x9e6274ff }\n theme_color: {tags:\"tab auto inactive background\", value: 0x2f2633ff }\n theme_color: {tags:\"tab auto inactive border\", value: 0x685073ff }\n theme_color: {tags:\"drop_site background\", value: 0xffffff05 }\n theme_color: {tags:\"drop_site border\", value: 0xffffff0f }\n}\n"), +str8_lit_comp("theme:\n{\n theme_color: {tags:\"background\", value: 0x1b1b1bff }\n theme_color: {tags:\"alt background\", value: 0x222222ff }\n theme_color: {tags:\"pop background\", value: 0x355b6eff }\n theme_color: {tags:\"fresh background\", value: 0x31393dff }\n theme_color: {tags:\"match background\", value: 0x31393dff }\n theme_color: {tags:\"border\", value: 0x404040ff }\n theme_color: {tags:\"text\", value: 0xe5e5e5ff }\n theme_color: {tags:\"weak text\", value: 0xa4a4a4ff }\n theme_color: {tags:\"good text\", value: 0x32a852ff }\n theme_color: {tags:\"neutral text\", value: 0x3a90bbff }\n theme_color: {tags:\"bad text\", value: 0xcf5242ff }\n theme_color: {tags:\"hover\", value: 0xffffffff }\n theme_color: {tags:\"focus\", value: 0xfda200ff }\n theme_color: {tags:\"cursor\", value: 0x8aff00ff }\n theme_color: {tags:\"selection\", value: 0x99ccffff }\n theme_color: {tags:\"inactive background\", value: 0x0000002f }\n theme_color: {tags:\"drop_shadow\", value: 0x0000007f }\n theme_color: {tags:\"good_pop background\", value: 0x2c5b36ff }\n theme_color: {tags:\"good_pop border\", value: 0x568761ff }\n theme_color: {tags:\"good_pop hover\", value: 0xe3f5d3ff }\n theme_color: {tags:\"good_pop weak text\", value: 0xe3f5d3ff }\n theme_color: {tags:\"bad_pop background\", value: 0x803425ff }\n theme_color: {tags:\"bad_pop hover\", value: 0xff825cff }\n theme_color: {tags:\"code_default\", value: 0xcbcbcbff }\n theme_color: {tags:\"code_symbol\", value: 0x42a2cfff }\n theme_color: {tags:\"code_type\", value: 0xfec746ff }\n theme_color: {tags:\"code_local\", value: 0x98bc80ff }\n theme_color: {tags:\"code_register\", value: 0xb7afd5ff }\n theme_color: {tags:\"code_keyword\", value: 0xb38d4cff }\n theme_color: {tags:\"code_delimiter_or_operator\", value: 0x767676ff }\n theme_color: {tags:\"code_numeric\", value: 0x98abb1ff }\n theme_color: {tags:\"code_numeric_alt_digit_group\", value: 0x738287ff }\n theme_color: {tags:\"code_string\", value: 0x98abb1ff }\n theme_color: {tags:\"code_meta\", value: 0xd96759ff }\n theme_color: {tags:\"code_comment\", value: 0x717171ff }\n theme_color: {tags:\"line_info_0\", value: 0x4f3022ff }\n theme_color: {tags:\"line_info_1\", value: 0x4f3e15ff }\n theme_color: {tags:\"line_info_2\", value: 0x434e2aff }\n theme_color: {tags:\"line_info_3\", value: 0x36241fff }\n theme_color: {tags:\"line_info_4\", value: 0x4f3022ff }\n theme_color: {tags:\"line_info_5\", value: 0x4f3e15ff }\n theme_color: {tags:\"line_info_6\", value: 0x434e2aff }\n theme_color: {tags:\"line_info_7\", value: 0x36241fff }\n theme_color: {tags:\"thread_0\", value: 0xffcb7fff }\n theme_color: {tags:\"thread_1\", value: 0xb2ff65ff }\n theme_color: {tags:\"thread_2\", value: 0xff99e5ff }\n theme_color: {tags:\"thread_3\", value: 0x6598ffff }\n theme_color: {tags:\"thread_4\", value: 0x65ffcbff }\n theme_color: {tags:\"thread_5\", value: 0xff9819ff }\n theme_color: {tags:\"thread_6\", value: 0x9932ffff }\n theme_color: {tags:\"thread_7\", value: 0x65ff4cff }\n theme_color: {tags:\"thread_unwound\", value: 0xb2ccd8ff }\n theme_color: {tags:\"thread_error\", value: 0xb23219ff }\n theme_color: {tags:\"breakpoint\", value: 0xa72911ff }\n theme_color: {tags:\"floating background\", value: 0x1b1b1baf }\n theme_color: {tags:\"floating background alt\", value: 0x0000005f }\n theme_color: {tags:\"floating background fresh\", value: 0x31393d5f }\n theme_color: {tags:\"floating border\", value: 0xbfbfbf1f }\n theme_color: {tags:\"floating scroll_bar background\", value: 0x3b3b3b5f }\n theme_color: {tags:\"floating scroll_bar border\", value: 0x5f5f5f5f }\n theme_color: {tags:\"menu_bar background\", value: 0x2b3740ff }\n theme_color: {tags:\"menu_bar border\", value: 0x3e4c57ff }\n theme_color: {tags:\"scroll_bar background\", value: 0x2b2b2bff }\n theme_color: {tags:\"scroll_bar border\", value: 0x3f3f3fff }\n theme_color: {tags:\"implicit background\", value: 0x00000000 }\n theme_color: {tags:\"implicit border\", value: 0x00000000 }\n theme_color: {tags:\"hollow background\", value: 0x00000000 }\n theme_color: {tags:\"hollow border\", value: 0xffffff1f }\n theme_color: {tags:\"tab background\", value: 0x6f5135ff }\n theme_color: {tags:\"tab border\", value: 0x8a6e54ff }\n theme_color: {tags:\"tab inactive background\", value: 0x2b3740ff }\n theme_color: {tags:\"tab inactive border\", value: 0x3e4c57ff }\n theme_color: {tags:\"tab auto background\", value: 0x693847ff }\n theme_color: {tags:\"tab auto border\", value: 0x9e6274ff }\n theme_color: {tags:\"tab auto inactive background\", value: 0x2f2633ff }\n theme_color: {tags:\"tab auto inactive border\", value: 0x685073ff }\n theme_color: {tags:\"drop_site background\", value: 0xffffff05 }\n theme_color: {tags:\"drop_site border\", value: 0xffffff0f }\n}\n"), str8_lit_comp(""), str8_lit_comp("theme:\n{\n background: 0x1b0000ff,\n}\n"), str8_lit_comp(""), diff --git a/src/raddbg/raddbg.mdesk b/src/raddbg/raddbg.mdesk index 7a302ff9..cfac11bd 100644 --- a/src/raddbg/raddbg.mdesk +++ b/src/raddbg/raddbg.mdesk @@ -245,6 +245,10 @@ RD_VocabTable: @display_name('Theme Colors') @description("Additional theme colors which are applied on top of the theme file or preset.") 'theme_colors': query, + //- rjf: autocompletion + @display_name('Autocompletion Lister') @description("Enables the autocompletion lister while typing expressions.") @default(1) + 'autocompletion_lister': bool, + //- rjf: thread & breakpoint decorations @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.") 'thread_lines': bool, @@ -487,14 +491,16 @@ RD_VocabTable: ``` @inherit(tab) x: { - @description("An expression to describe the base address or offset of the memory view.") + @display_name("Base Address") @description("An expression to describe the base address or offset of the memory view.") 'expression': code_string, - @description("The number of bytes of the viewed memory range.") + @display_name("Address Range Size") @description("The number of bytes of the viewed memory range.") 'size': code_string, + @display_name("Cursor Address") @description("The address of the cursor.") + 'cursor': code_string, + @display_name("Cursor Size") @description("The size, in bytes, of the cursor.") + 'cursor_size': @range[1, 16] u64, @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, } ``` } @@ -1358,6 +1364,7 @@ RD_ThemePresetTable: theme_color: {tags:"text", value: 0xe5e5e5ff } theme_color: {tags:"weak text", value: 0xa4a4a4ff } theme_color: {tags:"good text", value: 0x32a852ff } + theme_color: {tags:"neutral text", value: 0x3a90bbff } theme_color: {tags:"bad text", value: 0xcf5242ff } theme_color: {tags:"hover", value: 0xffffffff } theme_color: {tags:"focus", value: 0xfda200ff } diff --git a/src/raddbg/raddbg_core.c b/src/raddbg/raddbg_core.c index e94f2fca..17cf8baa 100644 --- a/src/raddbg/raddbg_core.c +++ b/src/raddbg/raddbg_core.c @@ -6675,7 +6675,7 @@ rd_window_frame(void) RD_Font(RD_FontSlot_Code) { //- rjf: add autocompletion view task - if(ws->autocomp_regs != 0 && ws->autocomp_last_frame_index+1 >= rd_state->frame_index) + if(rd_setting_b32_from_name(str8_lit("autocompletion_lister")) && ws->autocomp_regs != 0 && ws->autocomp_last_frame_index+1 >= rd_state->frame_index) { // rjf: build view RD_Cfg *root = rd_immediate_cfg_from_keyf("autocomp_view_%I64x", window->id); @@ -7616,18 +7616,18 @@ rd_window_frame(void) }; CenterButtonTask center_button_tasks[] = { - {rd_cmd_kind_info_table[RD_CmdKind_Run].string, str8_lit("good"), (can_send_signal || d_ctrl_last_run_frame_idx()+4 > d_frame_index())}, - {rd_cmd_kind_info_table[RD_CmdKind_Restart].string, str8_lit("good"), processes.count != 0}, - {rd_cmd_kind_info_table[RD_CmdKind_Halt].string, str8_lit("weak"), !can_send_signal}, - {rd_cmd_kind_info_table[RD_CmdKind_KillAll].string, str8_lit("bad"), processes.count != 0}, - {rd_cmd_kind_info_table[RD_CmdKind_StepOver].string, str8_lit("weak"), can_send_signal}, - {rd_cmd_kind_info_table[RD_CmdKind_StepInto].string, str8_lit("weak"), can_send_signal}, - {rd_cmd_kind_info_table[RD_CmdKind_StepOut].string, str8_lit("weak"), processes.count != 0 && can_send_signal}, + {rd_cmd_kind_info_table[RD_CmdKind_Run].string, str8_lit("good"), (can_send_signal || d_ctrl_last_run_frame_idx()+4 > d_frame_index())}, + {rd_cmd_kind_info_table[RD_CmdKind_Restart].string, str8_lit("neutral"), processes.count != 0}, + {rd_cmd_kind_info_table[RD_CmdKind_Halt].string, str8_lit("weak"), !can_send_signal}, + {rd_cmd_kind_info_table[RD_CmdKind_KillAll].string, str8_lit("bad"), processes.count != 0}, + {rd_cmd_kind_info_table[RD_CmdKind_StepOver].string, str8_lit("weak"), can_send_signal}, + {rd_cmd_kind_info_table[RD_CmdKind_StepInto].string, str8_lit("weak"), can_send_signal}, + {rd_cmd_kind_info_table[RD_CmdKind_StepOut].string, str8_lit("weak"), processes.count != 0 && can_send_signal}, }; UI_TextAlignment(UI_TextAlign_Center) for EachElement(idx, center_button_tasks) UI_Flags(center_button_tasks[idx].is_enabled ? 0 : UI_BoxFlag_Disabled) - UI_Tag(center_button_tasks[idx].is_enabled ? center_button_tasks[idx].tag : str8_lit("")) + UI_Tag(center_button_tasks[idx].is_enabled ? center_button_tasks[idx].tag : str8_lit("weak")) { String8 cmd_name = center_button_tasks[idx].cmd_name; UI_Signal sig = ui_button(rd_icon_kind_text_table[rd_icon_kind_from_code_name(cmd_name)]); @@ -10161,7 +10161,7 @@ rd_regs_fill_slot_from_string(RD_RegSlot slot, String8 string) } else { - log_user_errorf("Couldn't evaluate \"%S\" as an address.", string); + log_user_errorf("Couldn't evaluate `%S` as an address.", string); } }break; } diff --git a/src/raddbg/raddbg_views.c b/src/raddbg/raddbg_views.c index 3e9be2cb..cc6ee83a 100644 --- a/src/raddbg/raddbg_views.c +++ b/src/raddbg/raddbg_views.c @@ -2336,6 +2336,8 @@ RD_VIEW_UI_FUNCTION_DEF(disasm) typedef struct RD_MemoryViewState RD_MemoryViewState; struct RD_MemoryViewState { + Rng1U64 last_view_range; + Rng1U64 last_cursor_range; B32 center_cursor; B32 contain_cursor; }; @@ -2352,42 +2354,44 @@ RD_VIEW_UI_FUNCTION_DEF(memory) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); - HS_Scope *hs_scope = hs_scope_open(); RD_MemoryViewState *mv = rd_view_state(RD_MemoryViewState); ////////////////////////////// //- rjf: unpack parameterization info // - Rng1U64 space_range = e_range_from_eval(eval); + F32 main_font_size = ui_bottom_font_size(); + Rng1U64 view_range = e_range_from_eval(eval); U64 base_offset = e_base_offset_from_eval(eval); U64 size = rd_view_cfg_value_from_string(str8_lit("size")).u64; if(size == 0) { size = e_type_byte_size_from_key(e_type_key_unwrap(eval.irtree.type_key, E_TypeUnwrapFlag_AllDecorative)); } - space_range = r1u64(base_offset, base_offset+size); + view_range = r1u64(base_offset, base_offset+size); if(eval.space.kind == 0) { eval.space = rd_eval_space_from_ctrl_entity(ctrl_entity_from_handle(d_state->ctrl_entity_store, rd_regs()->process), RD_EvalSpaceKind_CtrlEntity); - space_range = rd_whole_range_from_eval_space(eval.space); + view_range = rd_whole_range_from_eval_space(eval.space); } - if(eval.space.kind == RD_EvalSpaceKind_CtrlEntity && dim_1u64(space_range) == KB(16)) + if(eval.space.kind == RD_EvalSpaceKind_CtrlEntity && dim_1u64(view_range) == KB(16)) { - space_range = r1u64(0, 0x7FFFFFFFFFFFull); + view_range = r1u64(0, 0x7FFFFFFFFFFFull); } - U64 cursor = rd_view_cfg_u64_from_string(str8_lit("cursor_vaddr")); - U64 mark = rd_view_cfg_u64_from_string(str8_lit("mark_vaddr")); - U64 bytes_per_cell = rd_view_cfg_u64_from_string(str8_lit("bytes_per_cell")); + U64 cursor_base_vaddr = rd_view_cfg_u64_from_string(str8_lit("cursor")); + U64 mark_base_vaddr = rd_view_cfg_u64_from_string(str8_lit("mark")); + U64 cursor_size = rd_view_cfg_u64_from_string(str8_lit("cursor_size")); + cursor_size = ClampBot(1, cursor_size); + U64 initial_cursor_base_vaddr = cursor_base_vaddr; + U64 initial_mark_base_vaddr = mark_base_vaddr; U64 num_columns = rd_view_cfg_u64_from_string(str8_lit("num_columns")); if(num_columns == 0) { num_columns = 16; } num_columns = ClampBot(1, num_columns); - bytes_per_cell = ClampBot(1, bytes_per_cell); UI_ScrollPt2 scroll_pos = rd_view_scroll_pos(); Vec4F32 selection_color = ui_color_from_name(str8_lit("selection")); - Vec4F32 border_color = ui_color_from_name(str8_lit("border")); + Vec4F32 border_color = ui_color_from_name(str8_lit("selection")); ////////////////////////////// //- rjf: process commands @@ -2408,7 +2412,7 @@ RD_VIEW_UI_FUNCTION_DEF(memory) }break; case RD_CmdKind_GoToAddress: { - cursor = mark = cmd->regs->vaddr; + cursor_base_vaddr = mark_base_vaddr = cmd->regs->vaddr; mv->center_cursor = 1; }break; } @@ -2422,47 +2426,68 @@ RD_VIEW_UI_FUNCTION_DEF(memory) F32 font_size = ui_top_font_size(); F32 big_glyph_advance = fnt_dim_from_tag_size_string(font, font_size, 0, 0, str8_lit("H")).x; F32 row_height_px = floor_f32(font_size*2.f); - F32 cell_width_px = floor_f32(font_size*2.f * bytes_per_cell); - F32 scroll_bar_dim = floor_f32(ui_top_font_size()*1.5f); - Vec2F32 panel_dim = dim_2f32(rect); - F32 footer_dim = font_size*10.f; - Rng2F32 header_rect = r2f32p(0, 0, panel_dim.x, row_height_px); - Rng2F32 footer_rect = r2f32p(0, panel_dim.y-footer_dim, panel_dim.x, panel_dim.y); - Rng2F32 content_rect = r2f32p(0, row_height_px, panel_dim.x-scroll_bar_dim, footer_rect.y0); + F32 cell_width_px = floor_f32(font_size*2.f); ////////////////////////////// //- rjf: determine legal scroll range // - Rng1S64 scroll_idx_rng = r1s64(0, dim_1u64(space_range)/num_columns); + U64 view_range_last = view_range.max; + if(view_range_last != 0) + { + view_range_last -= 1; + } + Rng1S64 scroll_idx_rng = r1s64(0, (view_range_last - view_range.min) / num_columns); ////////////////////////////// - //- rjf: determine info about visible range of rows + //- rjf: determine visible range of rows // Rng1S64 viz_range_rows = {0}; - Rng1U64 viz_range_bytes = {0}; S64 num_possible_visible_rows = 0; { - num_possible_visible_rows = dim_2f32(content_rect).y/row_height_px; + num_possible_visible_rows = dim_2f32(rect).y/row_height_px; viz_range_rows.min = scroll_pos.y.idx + (S64)scroll_pos.y.off - !!(scroll_pos.y.off<0); viz_range_rows.max = scroll_pos.y.idx + (S64)scroll_pos.y.off + num_possible_visible_rows, viz_range_rows.min = clamp_1s64(scroll_idx_rng, viz_range_rows.min); viz_range_rows.max = clamp_1s64(scroll_idx_rng, viz_range_rows.max); - viz_range_bytes.min = space_range.min + viz_range_rows.min*num_columns; - viz_range_bytes.max = space_range.min + (viz_range_rows.max+1)*num_columns+1; - if(viz_range_bytes.min > viz_range_bytes.max) - { - Swap(U64, viz_range_bytes.min, viz_range_bytes.max); - } - viz_range_bytes = intersect_1u64(space_range, viz_range_bytes); } + ////////////////////////////// + //- rjf: calculate rectangles + // + F32 scroll_bar_dim = floor_f32(main_font_size*1.5f); + Vec2F32 panel_dim = dim_2f32(rect); + F32 footer_dim = floor_f32(main_font_size*10.f); + Rng2F32 header_rect = r2f32p(0, 0, panel_dim.x, row_height_px); + Rng2F32 footer_rect = r2f32p(0, panel_dim.y-footer_dim, panel_dim.x-scroll_bar_dim, panel_dim.y); + Rng2F32 content_rect = r2f32p(0, row_height_px, panel_dim.x-scroll_bar_dim, panel_dim.y); + + ////////////////////////////// + //- rjf: bump backwards if we are past the first + if(viz_range_rows.min > 0) + { + viz_range_rows.min -= 1; + content_rect.y0 -= row_height_px; + } + + ////////////////////////////// + //- rjf: determine visible range of bytes + // + Rng1U64 viz_range_bytes = {0}; + viz_range_bytes.min = view_range.min + (viz_range_rows.min)*num_columns; + viz_range_bytes.max = view_range.min + (viz_range_rows.max+1)*num_columns+1; + if(viz_range_bytes.min > viz_range_bytes.max) + { + Swap(U64, viz_range_bytes.min, viz_range_bytes.max); + } + viz_range_bytes = intersect_1u64(view_range, viz_range_bytes); + ////////////////////////////// //- rjf: take keyboard controls // UI_Focus(UI_FocusKind_On) if(ui_is_focus_active()) { - U64 next_cursor = cursor; - U64 next_mark = mark; + U64 next_cursor_base_vaddr = cursor_base_vaddr; + U64 next_mark_base_vaddr = mark_base_vaddr; for(UI_Event *evt = 0; ui_next_event(&evt);) { Vec2S64 cell_delta = {0}; @@ -2479,11 +2504,11 @@ RD_VIEW_UI_FUNCTION_DEF(memory) { if(evt->delta_2s32.x < 0) { - cell_delta.x = -(S64)(cursor%num_columns); + cell_delta.x = -(S64)(cursor_base_vaddr%num_columns); } else if(evt->delta_2s32.x > 0) { - cell_delta.x = (num_columns-1) - (S64)(cursor%num_columns); + cell_delta.x = (num_columns-1) - (S64)(cursor_base_vaddr%num_columns); } if(evt->delta_2s32.y < 0) { @@ -2500,31 +2525,31 @@ RD_VIEW_UI_FUNCTION_DEF(memory) { good_action = 1; } - if(good_action && evt->flags & UI_EventFlag_ZeroDeltaOnSelect && cursor != mark) + if(good_action && evt->flags & UI_EventFlag_ZeroDeltaOnSelect && cursor_base_vaddr != mark_base_vaddr) { MemoryZeroStruct(&cell_delta); } if(good_action) { - cell_delta.x = ClampBot(cell_delta.x, (S64)-next_cursor); - cell_delta.y = ClampBot(cell_delta.y, (S64)-(next_cursor/num_columns)); - next_cursor += cell_delta.x; - next_cursor += cell_delta.y*num_columns; + cell_delta.x = ClampBot(cell_delta.x, (S64)-next_cursor_base_vaddr); + cell_delta.y = ClampBot(cell_delta.y, (S64)-(next_cursor_base_vaddr/num_columns)); + next_cursor_base_vaddr += cell_delta.x; + next_cursor_base_vaddr += cell_delta.y*num_columns; } - if(good_action && evt->flags & UI_EventFlag_PickSelectSide && cursor != mark) + if(good_action && evt->flags & UI_EventFlag_PickSelectSide && cursor_base_vaddr != mark_base_vaddr) { if(evt->delta_2s32.x < 0 || evt->delta_2s32.y < 0) { - next_cursor = Min(cursor, mark); + next_cursor_base_vaddr = Min(cursor_base_vaddr, mark_base_vaddr); } else { - next_cursor = Max(cursor, mark); + next_cursor_base_vaddr = Max(cursor_base_vaddr, mark_base_vaddr); } } if(good_action && !(evt->flags & UI_EventFlag_KeepMark)) { - next_mark = next_cursor; + next_mark_base_vaddr = next_cursor_base_vaddr; } if(good_action) { @@ -2532,21 +2557,54 @@ RD_VIEW_UI_FUNCTION_DEF(memory) ui_eat_event(evt); } } - cursor = next_cursor; - mark = next_mark; + cursor_base_vaddr = next_cursor_base_vaddr; + mark_base_vaddr = next_mark_base_vaddr; } ////////////////////////////// //- rjf: clamp cursor // + Rng1U64 cursor_valid_rng = view_range; + if(cursor_valid_rng.max != 0) { - Rng1U64 cursor_valid_rng = space_range; - if(cursor_valid_rng.max != 0) - { - cursor_valid_rng.max -= 1; - } - cursor = clamp_1u64(cursor_valid_rng, cursor); - mark = clamp_1u64(cursor_valid_rng, mark); + cursor_valid_rng.max -= 1; + } + if(cursor_base_vaddr != initial_cursor_base_vaddr) + { + cursor_base_vaddr = clamp_1u64(cursor_valid_rng, cursor_base_vaddr); + } + if(mark_base_vaddr != initial_mark_base_vaddr) + { + mark_base_vaddr = clamp_1u64(cursor_valid_rng, mark_base_vaddr); + } + + ////////////////////////////// + //- rjf: unpack post-move cursor/mark info + // + Rng1U64 cursor_range = r1u64(cursor_base_vaddr, cursor_base_vaddr + cursor_size); + Rng1U64 mark_range = r1u64(mark_base_vaddr, mark_base_vaddr + cursor_size); + Rng1U64 selection = union_1u64(r1u64(cursor_base_vaddr, cursor_base_vaddr+cursor_size-1), + r1u64(mark_base_vaddr, mark_base_vaddr+cursor_size-1)); + + ////////////////////////////// + //- rjf: center cursor if range has changed + // + if(mv->last_view_range.max != view_range.max || + mv->last_view_range.min != view_range.min) + { + mv->center_cursor = 1; + mv->last_view_range = view_range; + } + + ////////////////////////////// + //- rjf: match mark to cursor if cursor has changed + // + if(mv->last_cursor_range.min != cursor_range.min || + mv->last_cursor_range.max != cursor_range.max) + { + mv->contain_cursor = 1; + mv->last_cursor_range = cursor_range; + mark_range = cursor_range; } ////////////////////////////// @@ -2555,7 +2613,7 @@ RD_VIEW_UI_FUNCTION_DEF(memory) if(mv->center_cursor) { mv->center_cursor = 0; - S64 cursor_row_idx = cursor/num_columns; + S64 cursor_row_idx = (cursor_base_vaddr - view_range.min) / num_columns; S64 new_idx = (cursor_row_idx-num_possible_visible_rows/2+1); new_idx = clamp_1s64(scroll_idx_rng, new_idx); ui_scroll_pt_target_idx(&scroll_pos.y, new_idx); @@ -2567,7 +2625,7 @@ RD_VIEW_UI_FUNCTION_DEF(memory) if(mv->contain_cursor) { mv->contain_cursor = 0; - S64 cursor_row_idx = cursor/num_columns; + S64 cursor_row_idx = (cursor_base_vaddr - view_range.min) / num_columns; Rng1S64 cursor_viz_range = r1s64(clamp_1s64(scroll_idx_rng, cursor_row_idx-2), clamp_1s64(scroll_idx_rng, cursor_row_idx+3)); S64 min_delta = Min(0, cursor_viz_range.min-viz_range_rows.min); S64 max_delta = Max(0, cursor_viz_range.max-viz_range_rows.max); @@ -2577,11 +2635,12 @@ RD_VIEW_UI_FUNCTION_DEF(memory) } ////////////////////////////// - //- rjf: produce fancy string runs for all possible byte values in all cells + //- rjf: produce fancy strings for all possible byte values in all cells // DR_FStrList byte_fstrs[256] = {0}; { - Vec4F32 full_color = ui_color_from_name(str8_lit("text")); + Vec4F32 full_color = {0}; + UI_TagF("neutral") full_color = ui_color_from_name(str8_lit("text")); Vec4F32 zero_color = full_color; UI_TagF("weak") zero_color = ui_color_from_name(str8_lit("text")); for(U64 idx = 0; idx < ArrayCount(byte_fstrs); idx += 1) @@ -2759,27 +2818,49 @@ RD_VIEW_UI_FUNCTION_DEF(memory) container_box = ui_build_box_from_stringf(0, "memory_view_container"); } + ////////////////////////////// + //- rjf: build scroll bar + // + UI_Parent(container_box) UI_FontSize(main_font_size) + { + ui_set_next_fixed_x(content_rect.x1); + ui_set_next_fixed_y(0); + ui_set_next_fixed_width(scroll_bar_dim); + ui_set_next_fixed_height(dim_2f32(rect).y); + { + scroll_pos.y = ui_scroll_bar(Axis2_Y, + ui_px(scroll_bar_dim, 1.f), + scroll_pos.y, + scroll_idx_rng, + num_possible_visible_rows); + } + } + ////////////////////////////// //- rjf: build header // UI_Box *header_box = &ui_nil_box; - UI_Parent(container_box) + UI_Parent(container_box) UI_TagF("floating") { - UI_WidthFill UI_PrefHeight(ui_px(row_height_px, 1.f)) UI_Row - header_box = ui_build_box_from_stringf(UI_BoxFlag_DrawSideBottom, "table_header"); + UI_Rect(r2f32p(0, 0, dim_2f32(rect).x - scroll_bar_dim, row_height_px)) + header_box = ui_build_box_from_stringf(UI_BoxFlag_DrawSideBottom| + UI_BoxFlag_DrawBackground| + UI_BoxFlag_DrawDropShadow| + UI_BoxFlag_DrawBackgroundBlur| + UI_BoxFlag_Floating, "table_header"); UI_Parent(header_box) RD_Font(RD_FontSlot_Code) UI_FontSize(font_size) - UI_TagF("weak") { UI_PrefWidth(ui_px(big_glyph_advance*20.f, 1.f)) ui_labelf("Address"); UI_PrefWidth(ui_px(cell_width_px, 1.f)) UI_TextAlignment(UI_TextAlign_Center) { - Rng1U64 col_selection_rng = r1u64(cursor%num_columns, mark%num_columns); - for(U64 row_off = 0; row_off < num_columns*bytes_per_cell; row_off += bytes_per_cell) + Rng1U64 col_selection_rng = r1u64(cursor_base_vaddr%num_columns, mark_base_vaddr%num_columns); + for(U64 row_off = 0; row_off < num_columns; row_off += 1) { - ui_labelf("%I64X", row_off); + B32 column_is_selected = (selection.min%num_columns <= row_off && row_off <= selection.max%num_columns); + UI_TagF(column_is_selected ? "" : "weak") ui_labelf("%I64X", row_off); } } ui_spacer(ui_px(big_glyph_advance*1.5f, 1.f)); @@ -2788,20 +2869,46 @@ RD_VIEW_UI_FUNCTION_DEF(memory) } ////////////////////////////// - //- rjf: build scroll bar + //- rjf: build footer // - UI_Parent(container_box) + UI_Box *footer_box = &ui_nil_box; + UI_Parent(container_box) UI_FontSize(main_font_size) UI_TagF("floating") { - ui_set_next_fixed_x(content_rect.x1); - ui_set_next_fixed_y(content_rect.y0); - ui_set_next_fixed_width(scroll_bar_dim); - ui_set_next_fixed_height(dim_2f32(content_rect).y); + ui_set_next_fixed_x(footer_rect.x0); + ui_set_next_fixed_y(footer_rect.y0); + ui_set_next_fixed_width(dim_2f32(footer_rect).x); + ui_set_next_fixed_height(dim_2f32(footer_rect).y); + footer_box = ui_build_box_from_stringf(UI_BoxFlag_DrawSideTop|UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBackgroundBlur|UI_BoxFlag_DrawDropShadow, "footer"); + UI_Parent(footer_box) RD_Font(RD_FontSlot_Code) { - scroll_pos.y = ui_scroll_bar(Axis2_Y, - ui_px(scroll_bar_dim, 1.f), - scroll_pos.y, - scroll_idx_rng, - num_possible_visible_rows); + UI_PrefWidth(ui_em(7.5f, 1.f)) UI_HeightFill UI_Column UI_TagF("weak") + UI_PrefHeight(ui_em(2.f, 0.f)) + { + ui_labelf("Address:"); + ui_labelf("U8:"); + ui_labelf("U16:"); + ui_labelf("U32:"); + ui_labelf("U64:"); + } + UI_PrefWidth(ui_em(45.f, 1.f)) UI_HeightFill UI_Column + UI_PrefHeight(ui_em(2.f, 0.f)) + { + ui_labelf("%016I64X", cursor_base_vaddr); + { + U64 as_u8 = 0; + U64 as_u16 = 0; + U64 as_u32 = 0; + U64 as_u64 = 0; + e_space_read(eval.space, &as_u64, r1u64(cursor_base_vaddr, cursor_base_vaddr+1)); + as_u32 = *(U32 *)&as_u64; + as_u16 = *(U16 *)&as_u64; + as_u8 = *(U8 *)&as_u64; + ui_labelf("%02X (%I64u)", as_u8, as_u8); + ui_labelf("%04X (%I64u)", as_u16, as_u16); + ui_labelf("%08X (%I64u)", as_u32, as_u32); + ui_labelf("%016I64X (%I64u)", as_u64, as_u64); + } + } } } @@ -2815,10 +2922,8 @@ RD_VIEW_UI_FUNCTION_DEF(memory) ui_set_next_fixed_y(content_rect.y0); ui_set_next_fixed_width(dim_2f32(content_rect).x); ui_set_next_fixed_height(dim_2f32(content_rect).y); - ui_set_next_child_layout_axis(Axis2_Y); scrollable_box = ui_build_box_from_stringf(UI_BoxFlag_Clip| UI_BoxFlag_Scroll| - UI_BoxFlag_AllowOverflowX| UI_BoxFlag_AllowOverflowY, "scrollable_box"); container_box->view_off.x = container_box->view_off_target.x = scroll_pos.x.idx + scroll_pos.x.off; @@ -2833,7 +2938,6 @@ RD_VIEW_UI_FUNCTION_DEF(memory) UI_Parent(scrollable_box) UI_WidthFill UI_HeightFill { ui_set_next_child_layout_axis(Axis2_Y); - ui_set_next_hover_cursor(OS_Cursor_IBar); row_container_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable, "row_container"); UI_Parent(row_container_box) { @@ -2888,11 +2992,10 @@ RD_VIEW_UI_FUNCTION_DEF(memory) { mv->contain_cursor = 1; } - cursor = mouse_hover_byte_num-1; - cursor = clamp_1u64(space_range, cursor); + cursor_base_vaddr = mouse_hover_byte_num-1; if(ui_pressed(sig)) { - mark = cursor; + mark_base_vaddr = cursor_base_vaddr; } } @@ -2922,24 +3025,25 @@ RD_VIEW_UI_FUNCTION_DEF(memory) // UI_Parent(row_container_box) RD_Font(RD_FontSlot_Code) UI_FontSize(font_size) { - Rng1U64 selection = r1u64(cursor, mark); U8 *row_ascii_buffer = push_array(scratch.arena, U8, num_columns); UI_WidthFill UI_PrefHeight(ui_px(row_height_px, 1.f)) for(S64 row_idx = viz_range_rows.min; row_idx <= viz_range_rows.max; row_idx += 1) { - Rng1U64 row_range_bytes = r1u64(space_range.min + row_idx*num_columns, - space_range.min + (row_idx+1)*num_columns); - if(row_range_bytes.min >= space_range.max) + Rng1U64 row_range_bytes = r1u64(view_range.min + row_idx*num_columns, view_range.min + (row_idx+1)*num_columns); + if(row_range_bytes.min >= view_range.max) { break; } - B32 row_is_boundary = 0; - if(row_range_bytes.min%64 == 0) + UI_BoxFlags row_flags = 0; + if(row_range_bytes.min <= selection.min && selection.min < row_range_bytes.max) { - row_is_boundary = 1; - ui_set_next_tag(str8_lit("pop")); + row_flags |= UI_BoxFlag_DrawSideTop; } - UI_Box *row = ui_build_box_from_stringf(UI_BoxFlag_DrawSideTop*!!row_is_boundary, "row_%I64x", row_range_bytes.min); + if(row_range_bytes.min <= selection.max && selection.max < row_range_bytes.max) + { + row_flags |= UI_BoxFlag_DrawSideBottom; + } + UI_Box *row = ui_build_box_from_stringf(row_flags, "row_%I64x", row_range_bytes.min); UI_Parent(row) { UI_PrefWidth(ui_px(big_glyph_advance*20.f, 1.f)) @@ -3000,6 +3104,14 @@ RD_VIEW_UI_FUNCTION_DEF(memory) cell_bg_rgba = selection_color; cell_bg_rgba.w *= 0.2f; } + if(selection.min%num_columns == col_idx) + { + cell_flags |= UI_BoxFlag_DrawSideLeft; + } + if(selection.max%num_columns == col_idx) + { + cell_flags |= UI_BoxFlag_DrawSideRight; + } // rjf: build ui_set_next_background_color(cell_bg_rgba); @@ -3108,53 +3220,6 @@ RD_VIEW_UI_FUNCTION_DEF(memory) } } - ////////////////////////////// - //- rjf: build footer - // - UI_Box *footer_box = &ui_nil_box; - UI_Parent(container_box) - { - ui_set_next_fixed_x(footer_rect.x0); - ui_set_next_fixed_y(footer_rect.y0); - ui_set_next_fixed_width(dim_2f32(footer_rect).x); - ui_set_next_fixed_height(dim_2f32(footer_rect).y); - footer_box = ui_build_box_from_stringf(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawDropShadow, "footer"); - UI_Parent(footer_box) RD_Font(RD_FontSlot_Code) UI_FontSize(font_size) - { - UI_PrefWidth(ui_em(7.5f, 1.f)) UI_HeightFill UI_Column UI_TagF("weak") - UI_PrefHeight(ui_px(row_height_px, 0.f)) - { - ui_labelf("Address:"); - ui_labelf("U8:"); - ui_labelf("U16:"); - ui_labelf("U32:"); - ui_labelf("U64:"); - } - UI_PrefWidth(ui_em(45.f, 1.f)) UI_HeightFill UI_Column - UI_PrefHeight(ui_px(row_height_px, 0.f)) - { - B32 cursor_in_range = (viz_range_bytes.min <= cursor && cursor+8 <= viz_range_bytes.max); - ui_labelf("%016I64X", cursor); - if(cursor_in_range) - { - U64 as_u8 = 0; - U64 as_u16 = 0; - U64 as_u32 = 0; - U64 as_u64 = 0; - U64 cursor_off = cursor-viz_range_bytes.min; - as_u8 = (U64)*(U8 *)(visible_memory + cursor_off); - as_u16 = (U64)*(U16*)(visible_memory + cursor_off); - as_u32 = (U64)*(U32*)(visible_memory + cursor_off); - as_u64 = (U64)*(U64*)(visible_memory + cursor_off); - ui_labelf("%02X (%I64u)", as_u8, as_u8); - ui_labelf("%04X (%I64u)", as_u16, as_u16); - ui_labelf("%08X (%I64u)", as_u32, as_u32); - ui_labelf("%016I64X (%I64u)", as_u64, as_u64); - } - } - } - } - ////////////////////////////// //- rjf: scroll // @@ -3168,14 +3233,31 @@ RD_VIEW_UI_FUNCTION_DEF(memory) } } + ////////////////////////////// + //- rjf: re-clamp + // + if(cursor_base_vaddr != initial_cursor_base_vaddr) + { + cursor_base_vaddr = clamp_1u64(cursor_valid_rng, cursor_base_vaddr); + } + if(mark_base_vaddr != initial_mark_base_vaddr) + { + mark_base_vaddr = clamp_1u64(cursor_valid_rng, mark_base_vaddr); + } + ////////////////////////////// //- rjf: save parameters // - rd_store_view_param_u64(str8_lit("cursor_vaddr"), cursor); - rd_store_view_param_u64(str8_lit("mark_vaddr"), mark); + if(cursor_base_vaddr != initial_cursor_base_vaddr) + { + rd_store_view_param_u64(str8_lit("cursor"), cursor_base_vaddr); + } + if(mark_base_vaddr != initial_mark_base_vaddr) + { + rd_store_view_param_u64(str8_lit("mark"), mark_base_vaddr); + } rd_store_view_scroll_pos(scroll_pos); - hs_scope_close(hs_scope); scratch_end(scratch); ProfEnd(); }