diff --git a/src/dbg_engine/dbg_engine.mdesk b/src/dbg_engine/dbg_engine.mdesk index 2c054da3..e785b4b2 100644 --- a/src/dbg_engine/dbg_engine.mdesk +++ b/src/dbg_engine/dbg_engine.mdesk @@ -144,6 +144,128 @@ D_RegTable: @expand(D_RegTable a) `{OffsetOf(D_Regs, $(a.name_lower)), OffsetOf(D_Regs, $(a.name_lower)) + sizeof($(a.c_type))}` } +@gen +{ + `#define d_regs_lit_init_top \\` + @expand(D_RegTable a) `.$(a.name_lower) = d_regs()->$(a.name_lower),\\` + ``; +} + +//////////////////////////////// +//~ rjf: Message Tables + +@table(name name_lower show_in_ui show_in_ipc_docs q_slot q_ent_kind q_allow_files q_allow_folders q_keep_oi q_select_oi q_is_code q_required canonical_icon desc) +D_MsgKindTable: +{ + {Null null 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: low level target operations + {LaunchAndRun launch_and_run 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {LaunchAndInit launch_and_init 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {Kill kill 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {KillAll kill_all 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {Attach attach 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {Detach detach 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {Continue continue 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {StepIntoInst step_into_inst 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {StepOverInst step_over_inst 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {StepIntoLine step_into_line 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {StepOverLine step_over_line 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {StepOut step_out 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {Halt halt 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {SoftHaltRefresh soft_halt_refresh 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {SetThreadIP set_thread_ip 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: high level target operations + {RunToLine run_to_line 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {RunToAddress run_to_address 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {Run run 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {Restart restart 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {StepInto step_into 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {StepOver step_over 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: thread / frame selection + {SelectThread select_thread 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {SelectUnwind select_unwind 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {UpOneFrame up_one_frame 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {DownOneFrame down_one_frame 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: thread freezing/thawing + {FreezeThread freeze_thread 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ThawThread thaw_thread 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {FreezeProcess freeze_process 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ThawProcess thaw_process 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {FreezeMachine freeze_machine 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ThawMachine thaw_machine 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {FreezeLocalMachine freeze_local_machine 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ThawLocalMachine thaw_local_machine 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: path overrides + {SetFileOverrideLinkSrc set_file_override_link_src 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {SetFileOverrideLinkDst set_file_override_link_dst 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {SetFileReplacementPath set_file_replacement_path 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: auto view rules + {SetAutoViewRuleType set_auto_view_rule_type 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {SetAutoViewRuleViewRule set_auto_view_rule_view_rule 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: general entity operations + {EnableEntity enable_entity 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {EnableBreakpoint enable_breakpoint 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {EnableTarget enable_target 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {DisableEntity disable_entity 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {DisableBreakpoint disable_breakpoint 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {DisableTarget disable_target 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {FreezeEntity freeze_entity 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ThawEntity thaw_entity 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {RemoveEntity remove_entity 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {RemoveBreakpoint remove_breakpoint 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {RemoveTarget remove_target 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {NameEntity name_entity 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {DuplicateEntity duplicate_entity 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {RelocateEntity relocate_entity 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: breakpoints + {AddBreakpoint add_breakpoint 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ToggleBreakpoint toggle_breakpoint 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {AddAddressBreakpoint add_address_breakpoint 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {AddFunctionBreakpoint add_function_breakpoint 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: watch pins + {AddWatchPin add_watch_pin 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ToggleWatchPin toggle_watch_pin 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: watch expressions + {ToggleWatchExpression toggle_watch_expression 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: at-cursor operations + {ToggleBreakpointAtCursor toggle_breakpoint_at_cursor 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ToggleWatchPinAtCursor toggle_watch_pin_at_cursor 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ToggleWatchExpressionAtCursor toggle_watch_expression_at_cursor 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {GoToNameAtCursor go_to_name_at_cursor 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {RunToCursor run_to_cursor 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {SetNextStatement set_next_statement 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: targets + {AddTarget add_target 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {SelectTarget select_target 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {RetryEndedProcess retry_ended_process 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: meta + {RegisterAsJITDebugger register_as_jit_debugger 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {LogMarker log_marker 0 0 Null Nil 0 0 0 0 0 0 Null ""} +} + +@enum D_MsgKind: +{ + @expand(D_MsgKindTable a) `$(a.name)` +} + +@data(String8) d_msg_kind_name_lower_table: +{ + @expand(D_MsgKindTable a) `str8_lit_comp("$(a.name_lower)")` +} + //////////////////////////////// //~ rjf: Built-In Command Tables diff --git a/src/dbg_engine/dbg_engine_core.c b/src/dbg_engine/dbg_engine_core.c index 85803b4a..c97ff225 100644 --- a/src/dbg_engine/dbg_engine_core.c +++ b/src/dbg_engine/dbg_engine_core.c @@ -6215,6 +6215,19 @@ d_errorf(char *fmt, ...) scratch_end(scratch); } +//////////////////////////////// +//~ rjf: Message Functions + +internal void +d_msg_(D_MsgKind kind, D_Regs *regs) +{ + D_MsgNode *n = push_array(d_state->msgs_arena, D_MsgNode, 1); + SLLQueuePush(d_state->msgs.first, d_state->msgs.last, n); + d_state->msgs.count += 1; + n->v.kind = kind; + n->v.regs = d_regs_copy(d_state->msgs_arena, regs); +} + //////////////////////////////// //~ rjf: Main Layer Top-Level Calls diff --git a/src/dbg_engine/dbg_engine_core.h b/src/dbg_engine/dbg_engine_core.h index f2c81a25..17e6a5a1 100644 --- a/src/dbg_engine/dbg_engine_core.h +++ b/src/dbg_engine/dbg_engine_core.h @@ -657,6 +657,31 @@ struct D_EvalVizWindowedRowList U64 count_before_semantic; }; +//////////////////////////////// +//~ rjf: Message Types + +typedef struct D_Msg D_Msg; +struct D_Msg +{ + D_MsgKind kind; + D_Regs *regs; +}; + +typedef struct D_MsgNode D_MsgNode; +struct D_MsgNode +{ + D_MsgNode *next; + D_Msg v; +}; + +typedef struct D_MsgList D_MsgList; +struct D_MsgList +{ + D_MsgNode *first; + D_MsgNode *last; + U64 count; +}; + //////////////////////////////// //~ rjf: Command Specification Types @@ -957,6 +982,10 @@ struct D_State D_RegsNode base_regs; D_RegsNode *top_regs; + // rjf: messages + Arena *msgs_arena; + D_MsgList msgs; + // rjf: top-level command batch Arena *root_cmd_arena; D_CmdList root_cmds; @@ -1529,6 +1558,17 @@ internal void d_errorf(char *fmt, ...); __VA_ARGS__ \ }) +//////////////////////////////// +//~ rjf: Message Functions + +internal void d_msg_(D_MsgKind kind, D_Regs *regs); +#define d_msg(kind, ...) d_msg_((kind),\ +&(D_Regs)\ +{\ +d_regs_lit_init_top\ +__VA_ARGS__\ +}) + //////////////////////////////// //~ rjf: Main Layer Top-Level Calls diff --git a/src/dbg_engine/generated/dbg_engine.meta.c b/src/dbg_engine/generated/dbg_engine.meta.c index d82a7f5c..f7d85569 100644 --- a/src/dbg_engine/generated/dbg_engine.meta.c +++ b/src/dbg_engine/generated/dbg_engine.meta.c @@ -34,6 +34,81 @@ Rng1U64 d_reg_slot_range_table[26] = {OffsetOf(D_Regs, params_tree), OffsetOf(D_Regs, params_tree) + sizeof(MD_Node *)}, }; +String8 d_msg_kind_name_lower_table[71] = +{ +str8_lit_comp("null"), +str8_lit_comp("launch_and_run"), +str8_lit_comp("launch_and_init"), +str8_lit_comp("kill"), +str8_lit_comp("kill_all"), +str8_lit_comp("attach"), +str8_lit_comp("detach"), +str8_lit_comp("continue"), +str8_lit_comp("step_into_inst"), +str8_lit_comp("step_over_inst"), +str8_lit_comp("step_into_line"), +str8_lit_comp("step_over_line"), +str8_lit_comp("step_out"), +str8_lit_comp("halt"), +str8_lit_comp("soft_halt_refresh"), +str8_lit_comp("set_thread_ip"), +str8_lit_comp("run_to_line"), +str8_lit_comp("run_to_address"), +str8_lit_comp("run"), +str8_lit_comp("restart"), +str8_lit_comp("step_into"), +str8_lit_comp("step_over"), +str8_lit_comp("select_thread"), +str8_lit_comp("select_unwind"), +str8_lit_comp("up_one_frame"), +str8_lit_comp("down_one_frame"), +str8_lit_comp("freeze_thread"), +str8_lit_comp("thaw_thread"), +str8_lit_comp("freeze_process"), +str8_lit_comp("thaw_process"), +str8_lit_comp("freeze_machine"), +str8_lit_comp("thaw_machine"), +str8_lit_comp("freeze_local_machine"), +str8_lit_comp("thaw_local_machine"), +str8_lit_comp("set_file_override_link_src"), +str8_lit_comp("set_file_override_link_dst"), +str8_lit_comp("set_file_replacement_path"), +str8_lit_comp("set_auto_view_rule_type"), +str8_lit_comp("set_auto_view_rule_view_rule"), +str8_lit_comp("enable_entity"), +str8_lit_comp("enable_breakpoint"), +str8_lit_comp("enable_target"), +str8_lit_comp("disable_entity"), +str8_lit_comp("disable_breakpoint"), +str8_lit_comp("disable_target"), +str8_lit_comp("freeze_entity"), +str8_lit_comp("thaw_entity"), +str8_lit_comp("remove_entity"), +str8_lit_comp("remove_breakpoint"), +str8_lit_comp("remove_target"), +str8_lit_comp("name_entity"), +str8_lit_comp("duplicate_entity"), +str8_lit_comp("relocate_entity"), +str8_lit_comp("add_breakpoint"), +str8_lit_comp("toggle_breakpoint"), +str8_lit_comp("add_address_breakpoint"), +str8_lit_comp("add_function_breakpoint"), +str8_lit_comp("add_watch_pin"), +str8_lit_comp("toggle_watch_pin"), +str8_lit_comp("toggle_watch_expression"), +str8_lit_comp("toggle_breakpoint_at_cursor"), +str8_lit_comp("toggle_watch_pin_at_cursor"), +str8_lit_comp("toggle_watch_expression_at_cursor"), +str8_lit_comp("go_to_name_at_cursor"), +str8_lit_comp("run_to_cursor"), +str8_lit_comp("set_next_statement"), +str8_lit_comp("add_target"), +str8_lit_comp("select_target"), +str8_lit_comp("retry_ended_process"), +str8_lit_comp("register_as_jit_debugger"), +str8_lit_comp("log_marker"), +}; + Rng1U64 d_cmd_param_slot_range_table[23] = { {OffsetOf(D_CmdParams, window), OffsetOf(D_CmdParams, window) + sizeof(D_Handle)}, diff --git a/src/dbg_engine/generated/dbg_engine.meta.h b/src/dbg_engine/generated/dbg_engine.meta.h index 91bf2a52..d1b00360 100644 --- a/src/dbg_engine/generated/dbg_engine.meta.h +++ b/src/dbg_engine/generated/dbg_engine.meta.h @@ -36,6 +36,81 @@ D_RegSlot_String, D_RegSlot_ParamsTree, } D_RegSlot; +typedef enum D_MsgKind +{ +D_MsgKind_Null, +D_MsgKind_LaunchAndRun, +D_MsgKind_LaunchAndInit, +D_MsgKind_Kill, +D_MsgKind_KillAll, +D_MsgKind_Attach, +D_MsgKind_Detach, +D_MsgKind_Continue, +D_MsgKind_StepIntoInst, +D_MsgKind_StepOverInst, +D_MsgKind_StepIntoLine, +D_MsgKind_StepOverLine, +D_MsgKind_StepOut, +D_MsgKind_Halt, +D_MsgKind_SoftHaltRefresh, +D_MsgKind_SetThreadIP, +D_MsgKind_RunToLine, +D_MsgKind_RunToAddress, +D_MsgKind_Run, +D_MsgKind_Restart, +D_MsgKind_StepInto, +D_MsgKind_StepOver, +D_MsgKind_SelectThread, +D_MsgKind_SelectUnwind, +D_MsgKind_UpOneFrame, +D_MsgKind_DownOneFrame, +D_MsgKind_FreezeThread, +D_MsgKind_ThawThread, +D_MsgKind_FreezeProcess, +D_MsgKind_ThawProcess, +D_MsgKind_FreezeMachine, +D_MsgKind_ThawMachine, +D_MsgKind_FreezeLocalMachine, +D_MsgKind_ThawLocalMachine, +D_MsgKind_SetFileOverrideLinkSrc, +D_MsgKind_SetFileOverrideLinkDst, +D_MsgKind_SetFileReplacementPath, +D_MsgKind_SetAutoViewRuleType, +D_MsgKind_SetAutoViewRuleViewRule, +D_MsgKind_EnableEntity, +D_MsgKind_EnableBreakpoint, +D_MsgKind_EnableTarget, +D_MsgKind_DisableEntity, +D_MsgKind_DisableBreakpoint, +D_MsgKind_DisableTarget, +D_MsgKind_FreezeEntity, +D_MsgKind_ThawEntity, +D_MsgKind_RemoveEntity, +D_MsgKind_RemoveBreakpoint, +D_MsgKind_RemoveTarget, +D_MsgKind_NameEntity, +D_MsgKind_DuplicateEntity, +D_MsgKind_RelocateEntity, +D_MsgKind_AddBreakpoint, +D_MsgKind_ToggleBreakpoint, +D_MsgKind_AddAddressBreakpoint, +D_MsgKind_AddFunctionBreakpoint, +D_MsgKind_AddWatchPin, +D_MsgKind_ToggleWatchPin, +D_MsgKind_ToggleWatchExpression, +D_MsgKind_ToggleBreakpointAtCursor, +D_MsgKind_ToggleWatchPinAtCursor, +D_MsgKind_ToggleWatchExpressionAtCursor, +D_MsgKind_GoToNameAtCursor, +D_MsgKind_RunToCursor, +D_MsgKind_SetNextStatement, +D_MsgKind_AddTarget, +D_MsgKind_SelectTarget, +D_MsgKind_RetryEndedProcess, +D_MsgKind_RegisterAsJITDebugger, +D_MsgKind_LogMarker, +} D_MsgKind; + typedef enum D_CfgSrc { D_CfgSrc_User, @@ -421,6 +496,34 @@ U64 unwind_index; U64 inline_depth; }; +#define d_regs_lit_init_top \ +.module = d_regs()->module,\ +.process = d_regs()->process,\ +.thread = d_regs()->thread,\ +.window = d_regs()->window,\ +.panel = d_regs()->panel,\ +.view = d_regs()->view,\ +.prev_view = d_regs()->prev_view,\ +.dst_panel = d_regs()->dst_panel,\ +.entity = d_regs()->entity,\ +.entity_list = d_regs()->entity_list,\ +.unwind_count = d_regs()->unwind_count,\ +.inline_depth = d_regs()->inline_depth,\ +.file_path = d_regs()->file_path,\ +.cursor = d_regs()->cursor,\ +.mark = d_regs()->mark,\ +.text_key = d_regs()->text_key,\ +.lang_kind = d_regs()->lang_kind,\ +.lines = d_regs()->lines,\ +.dbgi_key = d_regs()->dbgi_key,\ +.vaddr_range = d_regs()->vaddr_range,\ +.voff_range = d_regs()->voff_range,\ +.force_confirm = d_regs()->force_confirm,\ +.prefer_disasm = d_regs()->prefer_disasm,\ +.dir2 = d_regs()->dir2,\ +.string = d_regs()->string,\ +.params_tree = d_regs()->params_tree,\ + D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(array); D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(slice); D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(bswap); @@ -461,6 +564,7 @@ struct {B32 *value_ptr; String8 name;} DEV_toggle_table[] = }; C_LINKAGE_BEGIN extern Rng1U64 d_reg_slot_range_table[26]; +extern String8 d_msg_kind_name_lower_table[71]; extern Rng1U64 d_cmd_param_slot_range_table[23]; extern String8 d_entity_kind_display_string_table[31]; extern String8 d_entity_kind_name_lower_table[31]; diff --git a/src/dbg_frontend/dbg_frontend.mdesk b/src/dbg_frontend/dbg_frontend.mdesk index 3288cb7e..3036ce49 100644 --- a/src/dbg_frontend/dbg_frontend.mdesk +++ b/src/dbg_frontend/dbg_frontend.mdesk @@ -1,6 +1,125 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) +//////////////////////////////// +//~ rjf: Message Tables + +@table(name name_lower show_in_ui show_in_ipc_docs q_slot q_ent_kind q_allow_files q_allow_folders q_keep_oi q_select_oi q_is_code q_required canonical_icon desc) +DF_MsgKindTable: +{ + {Null null 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: meta + {Exit exit 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {RunCommand run_command 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ToggleDevMenu toggle_dev_menu 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: config reading/writing + {ApplyUserData apply_user_data 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ApplyProjectData apply_project_data 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {WriteUserData write_user_data 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {WriteProjectData write_project_data 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: notifications + {Error error 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: windows + {OpenWindow open_window 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {CloseWindow close_window 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ToggleFullscreen toggle_fullscreen 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: confirmation + {ConfirmAccept confirm_accept 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ConfirmCancel confirm_cancel 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: queries + {CompleteQuery complete_query 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {CancelQuery cancel_query 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: searching + {FindTextForward find_text_forward 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {FindTextBackward find_text_backward 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {FindNext find_next 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {FindPrev find_prev 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: font sizes + {IncUIFontScale inc_ui_font_scale 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {DecUIFontScale dec_ui_font_scale 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {IncCodeFontScale inc_code_font_scale 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {DecCodeFontScale dec_code_font_scale 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: panel creation/removal + {NewPanelLeft new_panel_left 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {NewPanelUp new_panel_up 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {NewPanelRight new_panel_right 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {NewPanelDown new_panel_down 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {SplitPanel split_panel 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ClosePanel close_panel 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: panel rearranging + {RotatePanelColumns rotate_panel_columns 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: panel focusing + {NextPanel next_panel 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {PrevPanel prev_panel 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {FocusPanel focus_panel 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {FocusPanelRight focus_panel_right 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {FocusPanelLeft focus_panel_left 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {FocusPanelUp focus_panel_up 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {FocusPanelDown focus_panel_down 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: view history navigation + {GoBack go_back 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {GoForward go_forward 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: tab selection + {NextTab next_tab 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {PrevTab prev_tab 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: tab rearranging + {MoveTabRight move_tab_right 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {MoveTabLeft move_tab_left 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {MoveTab move_tab 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: tab creation/removal + {OpenTab open_tab 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {CloseTab close_tab 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: panel tab settings + {TabBarTop tab_bar_top 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {TabBarBottom tab_bar_bottom 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: tab filters + {Filter filter 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ClearFilter clear_filter 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ApplyFilter apply_filter 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: default panel layouts + {ResetToDefaultPanels reset_to_default_panels 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {ResetToCompactPanels reset_to_compact_panels 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: filesystem fast paths + {Open open 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {Switch switch 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {SwitchToPartnerFile switch_to_partner_file 0 0 Null Nil 0 0 0 0 0 0 Null ""} + + //- rjf: snapping to code locations + {FindThread find_thread 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {FindSelectedThread find_selected_thread 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {GoToName go_to_name 0 0 Null Nil 0 0 0 0 0 0 Null ""} + {FindCodeLocation find_code_location 0 0 Null Nil 0 0 0 0 0 0 Null ""} +} + +@enum DF_MsgKind: +{ + @expand(DF_MsgKindTable a) `$(a.name)` +} + +@data(String8) df_msg_kind_name_lower_table: +{ + @expand(DF_MsgKindTable a) `str8_lit_comp("$(a.name_lower)")` +} + //////////////////////////////// //~ rjf: Embedded Data diff --git a/src/dbg_frontend/dbg_frontend_core.h b/src/dbg_frontend/dbg_frontend_core.h index 7d97ce97..df2ac65f 100644 --- a/src/dbg_frontend/dbg_frontend_core.h +++ b/src/dbg_frontend/dbg_frontend_core.h @@ -919,6 +919,11 @@ internal String8 df_stop_explanation_string_icon_from_ctrl_event(Arena *arena, C internal void df_request_frame(void); +//////////////////////////////// +//~ rjf: Message Functions + + + //////////////////////////////// //~ rjf: Main Layer Top-Level Calls diff --git a/src/dbg_frontend/generated/dbg_frontend.meta.c b/src/dbg_frontend/generated/dbg_frontend.meta.c index b87db111..2db60f4b 100644 --- a/src/dbg_frontend/generated/dbg_frontend.meta.c +++ b/src/dbg_frontend/generated/dbg_frontend.meta.c @@ -4,6 +4,71 @@ //- GENERATED CODE C_LINKAGE_BEGIN +String8 df_msg_kind_name_lower_table[61] = +{ +str8_lit_comp("null"), +str8_lit_comp("exit"), +str8_lit_comp("run_command"), +str8_lit_comp("toggle_dev_menu"), +str8_lit_comp("apply_user_data"), +str8_lit_comp("apply_project_data"), +str8_lit_comp("write_user_data"), +str8_lit_comp("write_project_data"), +str8_lit_comp("error"), +str8_lit_comp("open_window"), +str8_lit_comp("close_window"), +str8_lit_comp("toggle_fullscreen"), +str8_lit_comp("confirm_accept"), +str8_lit_comp("confirm_cancel"), +str8_lit_comp("complete_query"), +str8_lit_comp("cancel_query"), +str8_lit_comp("find_text_forward"), +str8_lit_comp("find_text_backward"), +str8_lit_comp("find_next"), +str8_lit_comp("find_prev"), +str8_lit_comp("inc_ui_font_scale"), +str8_lit_comp("dec_ui_font_scale"), +str8_lit_comp("inc_code_font_scale"), +str8_lit_comp("dec_code_font_scale"), +str8_lit_comp("new_panel_left"), +str8_lit_comp("new_panel_up"), +str8_lit_comp("new_panel_right"), +str8_lit_comp("new_panel_down"), +str8_lit_comp("split_panel"), +str8_lit_comp("close_panel"), +str8_lit_comp("rotate_panel_columns"), +str8_lit_comp("next_panel"), +str8_lit_comp("prev_panel"), +str8_lit_comp("focus_panel"), +str8_lit_comp("focus_panel_right"), +str8_lit_comp("focus_panel_left"), +str8_lit_comp("focus_panel_up"), +str8_lit_comp("focus_panel_down"), +str8_lit_comp("go_back"), +str8_lit_comp("go_forward"), +str8_lit_comp("next_tab"), +str8_lit_comp("prev_tab"), +str8_lit_comp("move_tab_right"), +str8_lit_comp("move_tab_left"), +str8_lit_comp("move_tab"), +str8_lit_comp("open_tab"), +str8_lit_comp("close_tab"), +str8_lit_comp("tab_bar_top"), +str8_lit_comp("tab_bar_bottom"), +str8_lit_comp("filter"), +str8_lit_comp("clear_filter"), +str8_lit_comp("apply_filter"), +str8_lit_comp("reset_to_default_panels"), +str8_lit_comp("reset_to_compact_panels"), +str8_lit_comp("open"), +str8_lit_comp("switch"), +str8_lit_comp("switch_to_partner_file"), +str8_lit_comp("find_thread"), +str8_lit_comp("find_selected_thread"), +str8_lit_comp("go_to_name"), +str8_lit_comp("find_code_location"), +}; + DF_StringBindingPair df_g_default_binding_table[110] = { {str8_lit_comp("kill_all"), {OS_Key_F5, 0 |OS_EventFlag_Shift }}, diff --git a/src/dbg_frontend/generated/dbg_frontend.meta.h b/src/dbg_frontend/generated/dbg_frontend.meta.h index c11f655a..ef1ddc9d 100644 --- a/src/dbg_frontend/generated/dbg_frontend.meta.h +++ b/src/dbg_frontend/generated/dbg_frontend.meta.h @@ -6,6 +6,71 @@ #ifndef DBG_FRONTEND_META_H #define DBG_FRONTEND_META_H +typedef enum DF_MsgKind +{ +DF_MsgKind_Null, +DF_MsgKind_Exit, +DF_MsgKind_RunCommand, +DF_MsgKind_ToggleDevMenu, +DF_MsgKind_ApplyUserData, +DF_MsgKind_ApplyProjectData, +DF_MsgKind_WriteUserData, +DF_MsgKind_WriteProjectData, +DF_MsgKind_Error, +DF_MsgKind_OpenWindow, +DF_MsgKind_CloseWindow, +DF_MsgKind_ToggleFullscreen, +DF_MsgKind_ConfirmAccept, +DF_MsgKind_ConfirmCancel, +DF_MsgKind_CompleteQuery, +DF_MsgKind_CancelQuery, +DF_MsgKind_FindTextForward, +DF_MsgKind_FindTextBackward, +DF_MsgKind_FindNext, +DF_MsgKind_FindPrev, +DF_MsgKind_IncUIFontScale, +DF_MsgKind_DecUIFontScale, +DF_MsgKind_IncCodeFontScale, +DF_MsgKind_DecCodeFontScale, +DF_MsgKind_NewPanelLeft, +DF_MsgKind_NewPanelUp, +DF_MsgKind_NewPanelRight, +DF_MsgKind_NewPanelDown, +DF_MsgKind_SplitPanel, +DF_MsgKind_ClosePanel, +DF_MsgKind_RotatePanelColumns, +DF_MsgKind_NextPanel, +DF_MsgKind_PrevPanel, +DF_MsgKind_FocusPanel, +DF_MsgKind_FocusPanelRight, +DF_MsgKind_FocusPanelLeft, +DF_MsgKind_FocusPanelUp, +DF_MsgKind_FocusPanelDown, +DF_MsgKind_GoBack, +DF_MsgKind_GoForward, +DF_MsgKind_NextTab, +DF_MsgKind_PrevTab, +DF_MsgKind_MoveTabRight, +DF_MsgKind_MoveTabLeft, +DF_MsgKind_MoveTab, +DF_MsgKind_OpenTab, +DF_MsgKind_CloseTab, +DF_MsgKind_TabBarTop, +DF_MsgKind_TabBarBottom, +DF_MsgKind_Filter, +DF_MsgKind_ClearFilter, +DF_MsgKind_ApplyFilter, +DF_MsgKind_ResetToDefaultPanels, +DF_MsgKind_ResetToCompactPanels, +DF_MsgKind_Open, +DF_MsgKind_Switch, +DF_MsgKind_SwitchToPartnerFile, +DF_MsgKind_FindThread, +DF_MsgKind_FindSelectedThread, +DF_MsgKind_GoToName, +DF_MsgKind_FindCodeLocation, +} DF_MsgKind; + typedef enum DF_IconKind { DF_IconKind_Null, @@ -353,6 +418,7 @@ DF_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(no_addr); DF_VIEW_RULE_ROW_UI_FUNCTION_DEF(checkbox); DF_VIEW_RULE_ROW_UI_FUNCTION_DEF(color_rgba); C_LINKAGE_BEGIN +extern String8 df_msg_kind_name_lower_table[61]; extern DF_StringBindingPair df_g_default_binding_table[110]; extern String8 df_g_binding_version_remap_old_name_table[7]; extern String8 df_g_binding_version_remap_new_name_table[7];