diff --git a/src/dbg_engine/dbg_engine.mdesk b/src/dbg_engine/dbg_engine.mdesk index 27d986db..6c92cc68 100644 --- a/src/dbg_engine/dbg_engine.mdesk +++ b/src/dbg_engine/dbg_engine.mdesk @@ -231,8 +231,6 @@ D_CmdParamSlotTable: // / | | | \ / | | | | | D_CmdTable: // | | | | | | | | | | { - {Null 0 0 Null Nil 0 0 0 0 0 0 Null "" "" "" "" } - //- rjf: low-level target control operations {LaunchAndRun 1 1 EntityList Target 0 0 0 0 0 1 Play "launch_and_run" "Launch and Run" "Starts debugging a new instance of a target, then runs." "launch,start,run,target" } {LaunchAndInit 1 1 EntityList Target 0 0 0 0 0 1 PlayStepForward "launch_and_init" "Launch and Initialize" "Starts debugging a new instance of a target, then stops at the program's entry point." "launch,start,entry,point" } @@ -281,6 +279,7 @@ D_CmdTable: // | | | | @enum D_CmdKind: { + Null, @expand(D_CmdTable, a) `$(a.name)`, COUNT, } @@ -305,6 +304,7 @@ D_CmdTable: // | | | | @data(D_CmdSpecInfo) @c_file d_core_cmd_kind_spec_info_table: { + `{0}`, @expand(D_CmdTable, a) ```{ str8_lit_comp("$(a.string)"), str8_lit_comp("$(a.desc)"), str8_lit_comp("$(a.search_tags)"), str8_lit_comp("$(a.display_name)"), (D_CmdSpecFlag_ListInUI*$(a.ui_vis))|(D_CmdSpecFlag_ListInIPCDocs*$(a.ipc_docs_vis)), {D_CmdParamSlot_$(a.q_slot), D_EntityKind_$(a.q_ent_kind), (D_CmdQueryFlag_AllowFiles*$(a.q_allow_files))|(D_CmdQueryFlag_AllowFolders*$(a.q_allow_folders))|(D_CmdQueryFlag_CodeInput*$(a.q_is_code))|(D_CmdQueryFlag_KeepOldInput*$(a.q_keep_oi))|(D_CmdQueryFlag_SelectOldInput*$(a.q_select_oi))|(D_CmdQueryFlag_Required*$(a.q_required))}}```; } diff --git a/src/dbg_engine/generated/dbg_engine.meta.c b/src/dbg_engine/generated/dbg_engine.meta.c index 7a41c9cd..25a9b5c2 100644 --- a/src/dbg_engine/generated/dbg_engine.meta.c +++ b/src/dbg_engine/generated/dbg_engine.meta.c @@ -245,7 +245,7 @@ Rng1U64 d_cmd_param_slot_range_table[24] = D_CmdSpecInfo d_core_cmd_kind_spec_info_table[38] = { -{ str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), (D_CmdSpecFlag_ListInUI*0)|(D_CmdSpecFlag_ListInIPCDocs*0), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{0}, { str8_lit_comp("launch_and_run"), str8_lit_comp("Starts debugging a new instance of a target, then runs."), str8_lit_comp("launch,start,run,target"), str8_lit_comp("Launch and Run"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_EntityList, D_EntityKind_Target, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, { str8_lit_comp("launch_and_init"), str8_lit_comp("Starts debugging a new instance of a target, then stops at the program's entry point."), str8_lit_comp("launch,start,entry,point"), str8_lit_comp("Launch and Initialize"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_EntityList, D_EntityKind_Target, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, { str8_lit_comp("kill"), str8_lit_comp("Kills the specified existing debugged process(es)."), str8_lit_comp("stop,kill"), str8_lit_comp("Kill"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_EntityList, D_EntityKind_Process, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, diff --git a/src/dbg_frontend/dbg_frontend.mdesk b/src/dbg_frontend/dbg_frontend.mdesk index bce7824e..3c8210a4 100644 --- a/src/dbg_frontend/dbg_frontend.mdesk +++ b/src/dbg_frontend/dbg_frontend.mdesk @@ -36,8 +36,6 @@ // / | | | \ / | | | | | DF_CmdTable: // | | | | | | | | | | { - {Null 0 0 Null Nil 0 0 0 0 0 0 Null "" "" "" "" } - //- rjf: exiting {Exit 1 1 Null Nil 0 0 0 0 0 0 X "exit" "Exit" "Exits the debugger." "quit,close,abort" } @@ -305,12 +303,17 @@ DF_CmdTable: // | | | | @enum DF_CmdKind: { + `Null`, + @expand(D_CmdTable a) `$(a.name)`, @expand(DF_CmdTable, a) `$(a.name)`, COUNT, } @data(D_CmdSpecInfo) @c_file df_cmd_kind_spec_info_table: { + `{0}`, + @expand(D_CmdTable, a) + ```{ str8_lit_comp("$(a.string)"), str8_lit_comp("$(a.desc)"), str8_lit_comp("$(a.search_tags)"), str8_lit_comp("$(a.display_name)"), (D_CmdSpecFlag_ListInUI*$(a.ui_vis))|(D_CmdSpecFlag_ListInIPCDocs*$(a.ipc_docs_vis)), {D_CmdParamSlot_$(a.q_slot), D_EntityKind_$(a.q_ent_kind), (D_CmdQueryFlag_AllowFiles*$(a.q_allow_files))|(D_CmdQueryFlag_AllowFolders*$(a.q_allow_folders))|(D_CmdQueryFlag_CodeInput*$(a.q_is_code))|(D_CmdQueryFlag_KeepOldInput*$(a.q_keep_oi))|(D_CmdQueryFlag_SelectOldInput*$(a.q_select_oi))|(D_CmdQueryFlag_Required*$(a.q_required))}}```; @expand(DF_CmdTable, a) ```{ str8_lit_comp("$(a.string)"), str8_lit_comp("$(a.desc)"), str8_lit_comp("$(a.search_tags)"), str8_lit_comp("$(a.display_name)"), (D_CmdSpecFlag_ListInUI*$(a.ui_vis))|(D_CmdSpecFlag_ListInIPCDocs*$(a.ipc_docs_vis)), {D_CmdParamSlot_$(a.q_slot), D_EntityKind_$(a.q_ent_kind), (D_CmdQueryFlag_AllowFiles*$(a.q_allow_files))|(D_CmdQueryFlag_AllowFolders*$(a.q_allow_folders))|(D_CmdQueryFlag_CodeInput*$(a.q_is_code))|(D_CmdQueryFlag_KeepOldInput*$(a.q_keep_oi))|(D_CmdQueryFlag_SelectOldInput*$(a.q_select_oi))|(D_CmdQueryFlag_Required*$(a.q_required))}}```; } @@ -685,7 +688,9 @@ DF_ViewTable: @data(DF_IconKind) df_cmd_kind_icon_kind_table: { - @expand(DF_CmdTable a) `DF_IconKind_$(a.canonical_icon)` + DF_IconKind_Null, + @expand(D_CmdTable a) `DF_IconKind_$(a.canonical_icon)`, + @expand(DF_CmdTable a) `DF_IconKind_$(a.canonical_icon)`, } @data(DF_IconKind) df_entity_kind_icon_kind_table: diff --git a/src/dbg_frontend/dbg_frontend_core.c b/src/dbg_frontend/dbg_frontend_core.c index 163618fa..d456e7b7 100644 --- a/src/dbg_frontend/dbg_frontend_core.c +++ b/src/dbg_frontend/dbg_frontend_core.c @@ -1099,7 +1099,7 @@ df_window_from_os_handle(OS_Handle os) #endif internal void -df_window_update_and_render(Arena *arena, DF_Window *ws) +df_window_frame(DF_Window *ws) { ProfBeginFunction(); @@ -1141,445 +1141,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) } } - ////////////////////////////// - //- rjf: do core-layer commands & batch up commands to be dispatched to views - // - UI_EventList events = {0}; - ProfScope("do commands") - { - Temp scratch = scratch_begin(&arena, 1); - for(D_Cmd *cmd = 0; df_next_cmd(&cmd);) - { - temp_end(scratch); - - // rjf: get command info - D_CmdParams params = cmd->params; - DF_CmdKind kind = df_cmd_kind_from_string(cmd->spec->info.string); - - // rjf: mismatched window => skip - if(df_window_from_handle(params.window) != ws) - { - continue; - } - - // rjf: set up data for cases - Dir2 split_dir = Dir2_Invalid; - DF_Panel *split_panel = ws->focused_panel; - U64 panel_sib_off = 0; - U64 panel_child_off = 0; - Vec2S32 panel_change_dir = {0}; - - // rjf: dispatch by core command kind - switch(kind) - { - //- rjf: OS events - case DF_CmdKind_OSEvent: - { - OS_Event *os_event = params.os_event; - if(os_event != 0 && os_handle_match(os_event->window, ws->os)) - { - UI_Event ui_event = zero_struct; - UI_EventKind kind = UI_EventKind_Null; - { - switch(os_event->kind) - { - default:{}break; - case OS_EventKind_Press: {kind = UI_EventKind_Press;}break; - case OS_EventKind_Release: {kind = UI_EventKind_Release;}break; - case OS_EventKind_MouseMove: {kind = UI_EventKind_MouseMove;}break; - case OS_EventKind_Text: {kind = UI_EventKind_Text;}break; - case OS_EventKind_Scroll: {kind = UI_EventKind_Scroll;}break; - case OS_EventKind_FileDrop: {kind = UI_EventKind_FileDrop;}break; - } - } - ui_event.kind = kind; - ui_event.key = os_event->key; - ui_event.modifiers = os_event->flags; - ui_event.string = os_event->character ? str8_from_32(ui_build_arena(), str32(&os_event->character, 1)) : str8_zero(); - ui_event.paths = str8_list_copy(ui_build_arena(), &os_event->strings); - ui_event.pos = os_event->pos; - ui_event.delta_2f32 = os_event->delta; - ui_event.timestamp_us = os_event->timestamp_us; - ui_event_list_push(ui_build_arena(), &events, &ui_event); - } - }break; - - //- rjf: meta controls - case DF_CmdKind_Edit: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Press; - evt.slot = UI_EventActionSlot_Edit; - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_Accept: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Press; - evt.slot = UI_EventActionSlot_Accept; - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_Cancel: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Press; - evt.slot = UI_EventActionSlot_Cancel; - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - - //- rjf: directional movement & text controls - // - // NOTE(rjf): These all get funneled into a separate intermediate that - // can be used by the UI build phase for navigation and stuff, as well - // as builder codepaths that want to use these controls to modify text. - // - case DF_CmdKind_MoveLeft: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_PickSelectSide|UI_EventFlag_ZeroDeltaOnSelect|UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Char; - evt.delta_2s32 = v2s32(-1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveRight: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_PickSelectSide|UI_EventFlag_ZeroDeltaOnSelect|UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Char; - evt.delta_2s32 = v2s32(+1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveUp: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Char; - evt.delta_2s32 = v2s32(+0, -1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveDown: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Char; - evt.delta_2s32 = v2s32(+0, +1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveLeftSelect: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Char; - evt.delta_2s32 = v2s32(-1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveRightSelect: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Char; - evt.delta_2s32 = v2s32(+1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveUpSelect: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Char; - evt.delta_2s32 = v2s32(+0, -1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveDownSelect: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Char; - evt.delta_2s32 = v2s32(+0, +1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveLeftChunk: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Word; - evt.delta_2s32 = v2s32(-1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveRightChunk: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Word; - evt.delta_2s32 = v2s32(+1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveUpChunk: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Word; - evt.delta_2s32 = v2s32(+0, -1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveDownChunk: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Word; - evt.delta_2s32 = v2s32(+0, +1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveUpPage: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.delta_unit = UI_EventDeltaUnit_Page; - evt.delta_2s32 = v2s32(+0, -1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveDownPage: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.delta_unit = UI_EventDeltaUnit_Page; - evt.delta_2s32 = v2s32(+0, +1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveUpWhole: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.delta_unit = UI_EventDeltaUnit_Whole; - evt.delta_2s32 = v2s32(+0, -1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveDownWhole: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.delta_unit = UI_EventDeltaUnit_Whole; - evt.delta_2s32 = v2s32(+0, +1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveLeftChunkSelect: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Word; - evt.delta_2s32 = v2s32(-1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveRightChunkSelect: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Word; - evt.delta_2s32 = v2s32(+1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveUpChunkSelect: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Word; - evt.delta_2s32 = v2s32(+0, -1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveDownChunkSelect: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; - evt.delta_unit = UI_EventDeltaUnit_Word; - evt.delta_2s32 = v2s32(+0, +1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveUpPageSelect: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_KeepMark; - evt.delta_unit = UI_EventDeltaUnit_Page; - evt.delta_2s32 = v2s32(+0, -1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveDownPageSelect: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_KeepMark; - evt.delta_unit = UI_EventDeltaUnit_Page; - evt.delta_2s32 = v2s32(+0, +1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveUpWholeSelect: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_KeepMark; - evt.delta_unit = UI_EventDeltaUnit_Whole; - evt.delta_2s32 = v2s32(+0, -1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveDownWholeSelect: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_KeepMark; - evt.delta_unit = UI_EventDeltaUnit_Whole; - evt.delta_2s32 = v2s32(+0, +1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveUpReorder: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_Reorder; - evt.delta_unit = UI_EventDeltaUnit_Char; - evt.delta_2s32 = v2s32(+0, -1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveDownReorder: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_Reorder; - evt.delta_unit = UI_EventDeltaUnit_Char; - evt.delta_2s32 = v2s32(+0, +1); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveHome: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.delta_unit = UI_EventDeltaUnit_Line; - evt.delta_2s32 = v2s32(-1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveEnd: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.delta_unit = UI_EventDeltaUnit_Line; - evt.delta_2s32 = v2s32(+1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveHomeSelect: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_KeepMark; - evt.delta_unit = UI_EventDeltaUnit_Line; - evt.delta_2s32 = v2s32(-1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_MoveEndSelect: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Navigate; - evt.flags = UI_EventFlag_KeepMark; - evt.delta_unit = UI_EventDeltaUnit_Line; - evt.delta_2s32 = v2s32(+1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_SelectAll: - { - UI_Event evt1 = zero_struct; - evt1.kind = UI_EventKind_Navigate; - evt1.delta_unit = UI_EventDeltaUnit_Whole; - evt1.delta_2s32 = v2s32(-1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt1); - UI_Event evt2 = zero_struct; - evt2.kind = UI_EventKind_Navigate; - evt2.flags = UI_EventFlag_KeepMark; - evt2.delta_unit = UI_EventDeltaUnit_Whole; - evt2.delta_2s32 = v2s32(+1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt2); - }break; - case DF_CmdKind_DeleteSingle: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Edit; - evt.flags = UI_EventFlag_Delete; - evt.delta_unit = UI_EventDeltaUnit_Char; - evt.delta_2s32 = v2s32(+1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_DeleteChunk: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Edit; - evt.flags = UI_EventFlag_Delete; - evt.delta_unit = UI_EventDeltaUnit_Word; - evt.delta_2s32 = v2s32(+1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_BackspaceSingle: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Edit; - evt.flags = UI_EventFlag_Delete|UI_EventFlag_ZeroDeltaOnSelect; - evt.delta_unit = UI_EventDeltaUnit_Char; - evt.delta_2s32 = v2s32(-1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_BackspaceChunk: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Edit; - evt.flags = UI_EventFlag_Delete; - evt.delta_unit = UI_EventDeltaUnit_Word; - evt.delta_2s32 = v2s32(-1, +0); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_Copy: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Edit; - evt.flags = UI_EventFlag_Copy|UI_EventFlag_KeepMark; - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_Cut: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Edit; - evt.flags = UI_EventFlag_Copy|UI_EventFlag_Delete; - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_Paste: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Text; - evt.string = os_get_clipboard_text(ui_build_arena()); - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - case DF_CmdKind_InsertText: - { - UI_Event evt = zero_struct; - evt.kind = UI_EventKind_Text; - evt.string = params.string; - ui_event_list_push(ui_build_arena(), &events, &evt); - }break; - } - } - scratch_end(scratch); - } - ////////////////////////////// //- rjf: panels with no selected tabs? -> select. // panels with selected tabs? -> ensure they have active tabs. @@ -1783,7 +1344,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) } // rjf: begin & push initial stack values - ui_begin_build(ws->os, &events, &icon_info, &widget_palette_info, &animation_info, d_dt(), d_dt()); + ui_begin_build(ws->os, &ws->ui_events, &icon_info, &widget_palette_info, &animation_info, d_dt(), d_dt()); ui_push_font(main_font); ui_push_font_size(main_font_size); ui_push_text_padding(main_font_size*0.3f); @@ -1813,7 +1374,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) // if(ui_string_hover_active()) UI_Tooltip { - Temp scratch = scratch_begin(&arena, 1); + Temp scratch = scratch_begin(0, 0); String8 string = ui_string_hover_string(scratch.arena); DR_FancyRunList runs = ui_string_hover_runs(scratch.arena); UI_Box *box = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero()); @@ -1827,7 +1388,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) B32 drag_active = df_drag_is_active(); if(drag_active && window_is_focused) { - Temp scratch = scratch_begin(&arena, 1); + Temp scratch = scratch_begin(0, 0); DF_DragDropPayload *payload = &df_drag_drop_payload; DF_Panel *panel = df_panel_from_handle(payload->panel); D_Entity *entity = d_entity_from_handle(payload->entity); @@ -2020,7 +1581,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) // DF_Palette(DF_PaletteCode_Floating) { - Temp scratch = scratch_begin(&arena, 1); + Temp scratch = scratch_begin(0, 0); //- rjf: auto-close entity ctx menu if(ui_ctx_menu_is_open(df_state->entity_ctx_menu_key)) @@ -2067,18 +1628,18 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) } } } - d_cmd(D_CmdKind_SetThreadIP, .entity = d_handle_from_entity(thread), .vaddr = new_rip_vaddr); + df_cmd(DF_CmdKind_SetThreadIP, .entity = d_handle_from_entity(thread), .vaddr = new_rip_vaddr); ui_ctx_menu_close(); } if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Run To Line"))) { if(ws->code_ctx_menu_file_path.size != 0) { - d_cmd(D_CmdKind_RunToLine, .file_path = ws->code_ctx_menu_file_path, .text_point = range.min); + df_cmd(DF_CmdKind_RunToLine, .file_path = ws->code_ctx_menu_file_path, .text_point = range.min); } else { - d_cmd(D_CmdKind_RunToAddress, .vaddr = ws->code_ctx_menu_vaddr); + df_cmd(DF_CmdKind_RunToAddress, .vaddr = ws->code_ctx_menu_vaddr); } ui_ctx_menu_close(); } @@ -2335,11 +1896,11 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) ui_set_next_palette(df_palette_from_code(is_frozen ? DF_PaletteCode_NegativePopButton : DF_PaletteCode_PositivePopButton)); if(is_frozen && ui_clicked(df_icon_buttonf(DF_IconKind_Locked, 0, "Thaw###freeze_thaw"))) { - d_cmd(D_CmdKind_ThawEntity, .entity = d_handle_from_entity(entity)); + df_cmd(DF_CmdKind_ThawEntity, .entity = d_handle_from_entity(entity)); } if(!is_frozen && ui_clicked(df_icon_buttonf(DF_IconKind_Unlocked, 0, "Freeze###freeze_thaw"))) { - d_cmd(D_CmdKind_FreezeEntity, .entity = d_handle_from_entity(entity)); + df_cmd(DF_CmdKind_FreezeEntity, .entity = d_handle_from_entity(entity)); } } @@ -2375,7 +1936,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) } else if(ui_clicked(df_icon_buttonf(DF_IconKind_Thread, 0, "Select###select_entity"))) { - d_cmd(D_CmdKind_SelectThread, .entity = d_handle_from_entity(entity)); + df_cmd(DF_CmdKind_SelectThread, .entity = d_handle_from_entity(entity)); ui_ctx_menu_close(); } } @@ -2492,12 +2053,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) { if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Launch And Run"))) { - d_cmd(D_CmdKind_LaunchAndRun, .entity = d_handle_from_entity(entity)); + df_cmd(DF_CmdKind_LaunchAndRun, .entity = d_handle_from_entity(entity)); ui_ctx_menu_close(); } if(ui_clicked(df_icon_buttonf(DF_IconKind_PlayStepForward, 0, "Launch And Initialize"))) { - d_cmd(D_CmdKind_LaunchAndInit, .entity = d_handle_from_entity(entity)); + df_cmd(DF_CmdKind_LaunchAndInit, .entity = d_handle_from_entity(entity)); ui_ctx_menu_close(); } }break; @@ -2681,7 +2242,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) // rjf: param tree editing UI_TextPadding(ui_top_font_size()*1.5f) DF_Font(DF_FontSlot_Code) { - Temp scratch = scratch_begin(&arena, 1); + Temp scratch = scratch_begin(0, 0); D_ViewRuleSpec *core_vr_spec = d_view_rule_spec_from_string(view->spec->info.name); String8 schema_string = core_vr_spec->info.schema; MD_TokenizeResult schema_tokenize = md_tokenize_from_text(scratch.arena, schema_string); @@ -2784,7 +2345,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) UI_Box *autocomp_root_box = ui_box_from_key(ws->autocomp_root_key); if(!ui_box_is_nil(autocomp_root_box)) { - Temp scratch = scratch_begin(&arena, 1); + Temp scratch = scratch_begin(0, 0); //- rjf: unpack lister params D_Entity *thread = d_entity_from_handle(d_base_regs()->thread); @@ -3075,11 +2636,11 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) move_back_evt.kind = UI_EventKind_Navigate; move_back_evt.flags = UI_EventFlag_KeepMark; move_back_evt.delta_2s32.x = -(S32)query.size; - ui_event_list_push(ui_build_arena(), &events, &move_back_evt); + ui_event_list_push(ui_build_arena(), &ws->ui_events, &move_back_evt); UI_Event paste_evt = zero_struct; paste_evt.kind = UI_EventKind_Text; paste_evt.string = item->string; - ui_event_list_push(ui_build_arena(), &events, &paste_evt); + ui_event_list_push(ui_build_arena(), &ws->ui_events, &paste_evt); autocomp_box->default_nav_focus_hot_key = autocomp_box->default_nav_focus_active_key = autocomp_box->default_nav_focus_next_hot_key = autocomp_box->default_nav_focus_next_active_key = ui_key_zero(); } else if(item_box->flags & UI_BoxFlag_FocusHot && !(item_box->flags & UI_BoxFlag_FocusHotDisabled)) @@ -3087,7 +2648,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) UI_Event evt = zero_struct; evt.kind = UI_EventKind_AutocompleteHint; evt.string = item->string; - ui_event_list_push(ui_build_arena(), &events, &evt); + ui_event_list_push(ui_build_arena(), &ws->ui_events, &evt); } } } @@ -3294,7 +2855,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) UI_PrefWidth(ui_em(50.f, 1.f)) DF_Palette(DF_PaletteCode_ImplicitButton) { - Temp scratch = scratch_begin(&arena, 1); + Temp scratch = scratch_begin(0, 0); D_CmdSpec *cmds[] = { df_cmd_spec_from_kind(DF_CmdKind_AddTarget), @@ -3515,7 +3076,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) UI_PrefWidth(ui_text_dim(10, 1)) UI_HeightFill DF_Palette(DF_PaletteCode_NeutralPopButton) { - Temp scratch = scratch_begin(&arena, 1); + Temp scratch = scratch_begin(0, 0); D_EntityList tasks = d_query_cached_entity_list_with_kind(D_EntityKind_ConversionTask); for(D_EntityNode *n = tasks.first; n != 0; n = n->next) { @@ -3546,7 +3107,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) DF_Font(DF_FontSlot_Icons) UI_FontSize(ui_top_font_size()*0.85f) { - Temp scratch = scratch_begin(&arena, 1); + Temp scratch = scratch_begin(0, 0); D_EntityList targets = d_push_active_target_list(scratch.arena); D_EntityList processes = d_query_cached_entity_list_with_kind(D_EntityKind_Process); B32 have_targets = targets.count != 0; @@ -3594,7 +3155,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) } if(ui_clicked(sig)) { - d_cmd(D_CmdKind_Run); + df_cmd(DF_CmdKind_Run); } } @@ -3628,7 +3189,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) } if(ui_clicked(sig)) { - d_cmd(D_CmdKind_Restart); + df_cmd(DF_CmdKind_Restart); } } @@ -3654,7 +3215,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) } if(ui_clicked(sig)) { - d_cmd(D_CmdKind_Halt); + df_cmd(DF_CmdKind_Halt); } } @@ -3683,7 +3244,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) } if(ui_clicked(sig)) { - d_cmd(D_CmdKind_Kill); + df_cmd(DF_CmdKind_Kill); } } @@ -3715,7 +3276,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) } if(ui_clicked(sig)) { - d_cmd(D_CmdKind_StepOver); + df_cmd(DF_CmdKind_StepOver); } } @@ -3747,7 +3308,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) } if(ui_clicked(sig)) { - d_cmd(D_CmdKind_StepInto); + df_cmd(DF_CmdKind_StepInto); } } @@ -3779,7 +3340,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) } if(ui_clicked(sig)) { - d_cmd(D_CmdKind_StepOut); + df_cmd(DF_CmdKind_StepOut); } } @@ -3962,7 +3523,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) } else { - Temp scratch = scratch_begin(&arena, 1); + Temp scratch = scratch_begin(0, 0); DF_IconKind icon = DF_IconKind_Null; String8 explanation = str8_lit("Not running"); { @@ -4032,7 +3593,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) if(ws->query_view_stack_top->spec != view_spec || df_view_is_nil(ws->query_view_stack_top)) { - Temp scratch = scratch_begin(&arena, 1); + Temp scratch = scratch_begin(0, 0); // rjf: clear existing query stack for(DF_View *query_view = ws->query_view_stack_top, *next = 0; @@ -4234,7 +3795,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) } if((ui_is_focus_active() && ui_slot_press(UI_EventActionSlot_Accept)) || query_completed) { - Temp scratch = scratch_begin(&arena, 1); + Temp scratch = scratch_begin(0, 0); DF_View *view = ws->query_view_stack_top; D_CmdParams params = df_cmd_params_from_window(ws); String8 error = d_cmd_params_apply_spec_query(scratch.arena, ¶ms, ws->query_cmd_spec, str8(view->query_buffer, view->query_string_size)); @@ -4322,7 +3883,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) UI_FontSize(df_font_size_from_slot(DF_FontSlot_Main)) DF_Palette(DF_PaletteCode_Floating) { - Temp scratch = scratch_begin(&arena, 1); + Temp scratch = scratch_begin(0, 0); DI_Scope *scope = di_scope_open(); D_Entity *thread = d_entity_from_handle(d_base_regs()->thread); D_Entity *process = d_entity_ancestor_from_kind(thread, D_EntityKind_Process); @@ -5340,7 +4901,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) // UI_Focus(UI_FocusKind_Off) { - Temp scratch = scratch_begin(&arena, 1); + Temp scratch = scratch_begin(0, 0); // rjf: types typedef struct DropSite DropSite; @@ -5373,7 +4934,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) } UI_Parent(tab_bar_box) UI_PrefHeight(ui_pct(1, 0)) { - Temp scratch = scratch_begin(&arena, 1); + Temp scratch = scratch_begin(0, 0); F32 corner_radius = ui_em(0.6f, 1.f).value; ui_spacer(ui_px(1.f, 1.f)); @@ -5924,7 +5485,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws) D_BucketScope(ws->draw_bucket) ProfScope("draw UI") { - Temp scratch = scratch_begin(&arena, 1); + Temp scratch = scratch_begin(0, 0); //- rjf: set up heatmap buckets F32 heatmap_bucket_size = 32.f; @@ -8111,7 +7672,7 @@ df_frame(void) df_request_frame(); df_unbind_spec(df_state->bind_change_cmd_spec, df_state->bind_change_binding); df_state->bind_change_active = 0; - d_cmd(d_cfg_src_write_cmd_kind_table[D_CfgSrc_User]); + df_cmd(d_cfg_src_write_cmd_kind_table[D_CfgSrc_User]); } for(OS_Event *event = events.first, *next = 0; event != 0; event = next) { @@ -8138,7 +7699,7 @@ df_frame(void) U32 codepoint = os_codepoint_from_event_flags_and_key(event->flags, event->key); os_text(&events, os_handle_zero(), codepoint); os_eat_event(&events, event); - d_cmd(d_cfg_src_write_cmd_kind_table[D_CfgSrc_User]); + df_cmd(d_cfg_src_write_cmd_kind_table[D_CfgSrc_User]); df_request_frame(); break; } @@ -8217,7 +7778,7 @@ df_frame(void) } U32 hit_char = os_codepoint_from_event_flags_and_key(event->flags, event->key); take = 1; - d_push_cmd(run_spec, ¶ms); + df_push_cmd(run_spec, ¶ms); if(event->flags & OS_EventFlag_Alt) { window->menu_bar_focus_press_started = 0; @@ -8237,7 +7798,7 @@ df_frame(void) String8 insertion8 = str8_from_32(scratch.arena, insertion32); D_CmdSpec *spec = df_cmd_spec_from_kind(DF_CmdKind_InsertText); params.string = insertion8; - d_push_cmd(spec, ¶ms); + df_push_cmd(spec, ¶ms); df_request_frame(); take = 1; if(event->flags & OS_EventFlag_Alt) @@ -8490,10 +8051,18 @@ df_frame(void) Vec2S32 panel_change_dir = {0}; switch(kind) { - //- rjf: default -> try to open tabs for "view driver" commands + //- rjf: default cases default: { String8 name = cmd->spec->info.string; + + // rjf: try to run engine command + if(D_CmdKind_Null < (D_CmdKind)kind && (D_CmdKind)kind < D_CmdKind_COUNT) + { + d_push_cmd(cmd->spec, params); + } + + // rjf: try to open tabs for "view driver" commands DF_ViewSpec *view_spec = df_view_spec_from_string(name); if(view_spec != &df_nil_view_spec) { @@ -8515,7 +8084,6 @@ df_frame(void) // rjf: command simply executes - just no-op in this layer if(!d_cmd_spec_is_nil(spec) && !(spec->info.query.flags & D_CmdQueryFlag_Required)) { - d_push_cmd(spec, params); df_push_cmd(spec, params); } @@ -8656,7 +8224,7 @@ df_frame(void) df_state->confirm_key = ui_key_zero(); for(D_CmdNode *n = df_state->confirm_cmds.first; n != 0; n = n->next) { - d_push_cmd(n->cmd.spec, &n->cmd.params); + df_push_cmd(n->cmd.spec, &n->cmd.params); } }break; case DF_CmdKind_ConfirmCancel: @@ -10852,8 +10420,8 @@ df_frame(void) // rjf: dispatch cfg saves for(D_CfgSrc src = (D_CfgSrc)0; src < D_CfgSrc_COUNT; src = (D_CfgSrc)(src+1)) { - D_CmdKind write_cmd = d_cfg_src_write_cmd_kind_table[src]; - d_cmd(write_cmd, .file_path = d_cfg_path_from_src(src)); + DF_CmdKind write_cmd = d_cfg_src_write_cmd_kind_table[src]; + df_cmd(write_cmd, .file_path = d_cfg_path_from_src(src)); } }break; @@ -11146,7 +10714,7 @@ df_frame(void) }break; case D_EntityKind_Thread: { - d_cmd(D_CmdKind_SelectThread, .entity = d_handle_from_entity(entity)); + df_cmd(DF_CmdKind_SelectThread, .entity = d_handle_from_entity(entity)); }break; case D_EntityKind_Target: { @@ -11535,7 +11103,7 @@ df_frame(void) // rjf: push command if possible if(command_ready) { - d_push_cmd(ws->query_cmd_spec, &ws->query_cmd_params); + df_push_cmd(ws->query_cmd_spec, &ws->query_cmd_params); } }break; case DF_CmdKind_CancelQuery: @@ -11902,10 +11470,465 @@ df_frame(void) { log_infof("\"#MARKER\""); }break; + + //- rjf: OS events + case DF_CmdKind_OSEvent: + { + OS_Event *os_event = params->os_event; + DF_Window *ws = df_window_from_os_handle(os_event->window); + if(os_event != 0 && ws != 0) + { + UI_Event ui_event = zero_struct; + UI_EventKind kind = UI_EventKind_Null; + { + switch(os_event->kind) + { + default:{}break; + case OS_EventKind_Press: {kind = UI_EventKind_Press;}break; + case OS_EventKind_Release: {kind = UI_EventKind_Release;}break; + case OS_EventKind_MouseMove: {kind = UI_EventKind_MouseMove;}break; + case OS_EventKind_Text: {kind = UI_EventKind_Text;}break; + case OS_EventKind_Scroll: {kind = UI_EventKind_Scroll;}break; + case OS_EventKind_FileDrop: {kind = UI_EventKind_FileDrop;}break; + } + } + ui_event.kind = kind; + ui_event.key = os_event->key; + ui_event.modifiers = os_event->flags; + ui_event.string = os_event->character ? str8_from_32(ui_build_arena(), str32(&os_event->character, 1)) : str8_zero(); + ui_event.paths = str8_list_copy(ui_build_arena(), &os_event->strings); + ui_event.pos = os_event->pos; + ui_event.delta_2f32 = os_event->delta; + ui_event.timestamp_us = os_event->timestamp_us; + ui_event_list_push(scratch.arena, &ws->ui_events, &ui_event); + } + }break; + + //- rjf: meta controls + case DF_CmdKind_Edit: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Press; + evt.slot = UI_EventActionSlot_Edit; + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_Accept: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Press; + evt.slot = UI_EventActionSlot_Accept; + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_Cancel: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Press; + evt.slot = UI_EventActionSlot_Cancel; + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + + //- rjf: directional movement & text controls + // + // NOTE(rjf): These all get funneled into a separate intermediate that + // can be used by the UI build phase for navigation and stuff, as well + // as builder codepaths that want to use these controls to modify text. + // + case DF_CmdKind_MoveLeft: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_PickSelectSide|UI_EventFlag_ZeroDeltaOnSelect|UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Char; + evt.delta_2s32 = v2s32(-1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveRight: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_PickSelectSide|UI_EventFlag_ZeroDeltaOnSelect|UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Char; + evt.delta_2s32 = v2s32(+1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveUp: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Char; + evt.delta_2s32 = v2s32(+0, -1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveDown: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Char; + evt.delta_2s32 = v2s32(+0, +1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveLeftSelect: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Char; + evt.delta_2s32 = v2s32(-1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveRightSelect: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Char; + evt.delta_2s32 = v2s32(+1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveUpSelect: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Char; + evt.delta_2s32 = v2s32(+0, -1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveDownSelect: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Char; + evt.delta_2s32 = v2s32(+0, +1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveLeftChunk: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Word; + evt.delta_2s32 = v2s32(-1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveRightChunk: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Word; + evt.delta_2s32 = v2s32(+1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveUpChunk: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Word; + evt.delta_2s32 = v2s32(+0, -1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveDownChunk: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Word; + evt.delta_2s32 = v2s32(+0, +1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveUpPage: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.delta_unit = UI_EventDeltaUnit_Page; + evt.delta_2s32 = v2s32(+0, -1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveDownPage: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.delta_unit = UI_EventDeltaUnit_Page; + evt.delta_2s32 = v2s32(+0, +1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveUpWhole: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.delta_unit = UI_EventDeltaUnit_Whole; + evt.delta_2s32 = v2s32(+0, -1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveDownWhole: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.delta_unit = UI_EventDeltaUnit_Whole; + evt.delta_2s32 = v2s32(+0, +1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveLeftChunkSelect: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Word; + evt.delta_2s32 = v2s32(-1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveRightChunkSelect: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Word; + evt.delta_2s32 = v2s32(+1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveUpChunkSelect: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Word; + evt.delta_2s32 = v2s32(+0, -1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveDownChunkSelect: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_KeepMark|UI_EventFlag_ExplicitDirectional; + evt.delta_unit = UI_EventDeltaUnit_Word; + evt.delta_2s32 = v2s32(+0, +1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveUpPageSelect: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_KeepMark; + evt.delta_unit = UI_EventDeltaUnit_Page; + evt.delta_2s32 = v2s32(+0, -1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveDownPageSelect: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_KeepMark; + evt.delta_unit = UI_EventDeltaUnit_Page; + evt.delta_2s32 = v2s32(+0, +1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveUpWholeSelect: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_KeepMark; + evt.delta_unit = UI_EventDeltaUnit_Whole; + evt.delta_2s32 = v2s32(+0, -1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveDownWholeSelect: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_KeepMark; + evt.delta_unit = UI_EventDeltaUnit_Whole; + evt.delta_2s32 = v2s32(+0, +1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveUpReorder: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_Reorder; + evt.delta_unit = UI_EventDeltaUnit_Char; + evt.delta_2s32 = v2s32(+0, -1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveDownReorder: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_Reorder; + evt.delta_unit = UI_EventDeltaUnit_Char; + evt.delta_2s32 = v2s32(+0, +1); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveHome: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.delta_unit = UI_EventDeltaUnit_Line; + evt.delta_2s32 = v2s32(-1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveEnd: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.delta_unit = UI_EventDeltaUnit_Line; + evt.delta_2s32 = v2s32(+1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveHomeSelect: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_KeepMark; + evt.delta_unit = UI_EventDeltaUnit_Line; + evt.delta_2s32 = v2s32(-1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_MoveEndSelect: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Navigate; + evt.flags = UI_EventFlag_KeepMark; + evt.delta_unit = UI_EventDeltaUnit_Line; + evt.delta_2s32 = v2s32(+1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_SelectAll: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt1 = zero_struct; + evt1.kind = UI_EventKind_Navigate; + evt1.delta_unit = UI_EventDeltaUnit_Whole; + evt1.delta_2s32 = v2s32(-1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt1); + UI_Event evt2 = zero_struct; + evt2.kind = UI_EventKind_Navigate; + evt2.flags = UI_EventFlag_KeepMark; + evt2.delta_unit = UI_EventDeltaUnit_Whole; + evt2.delta_2s32 = v2s32(+1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt2); + }break; + case DF_CmdKind_DeleteSingle: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Edit; + evt.flags = UI_EventFlag_Delete; + evt.delta_unit = UI_EventDeltaUnit_Char; + evt.delta_2s32 = v2s32(+1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_DeleteChunk: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Edit; + evt.flags = UI_EventFlag_Delete; + evt.delta_unit = UI_EventDeltaUnit_Word; + evt.delta_2s32 = v2s32(+1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_BackspaceSingle: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Edit; + evt.flags = UI_EventFlag_Delete|UI_EventFlag_ZeroDeltaOnSelect; + evt.delta_unit = UI_EventDeltaUnit_Char; + evt.delta_2s32 = v2s32(-1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_BackspaceChunk: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Edit; + evt.flags = UI_EventFlag_Delete; + evt.delta_unit = UI_EventDeltaUnit_Word; + evt.delta_2s32 = v2s32(-1, +0); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_Copy: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Edit; + evt.flags = UI_EventFlag_Copy|UI_EventFlag_KeepMark; + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_Cut: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Edit; + evt.flags = UI_EventFlag_Copy|UI_EventFlag_Delete; + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_Paste: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Text; + evt.string = os_get_clipboard_text(scratch.arena); + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; + case DF_CmdKind_InsertText: + { + DF_Window *ws = df_window_from_handle(params->window); + UI_Event evt = zero_struct; + evt.kind = UI_EventKind_Text; + evt.string = params->string; + ui_event_list_push(scratch.arena, &ws->ui_events, &evt); + }break; } } } + ////////////////////////////// + //- rjf: clear commands + // + { + arena_clear(df_state->cmds_arena); + MemoryZeroStruct(&df_state->cmds); + } + ////////////////////////////// //- rjf: gather targets // @@ -12071,7 +12094,8 @@ df_frame(void) } d_push_regs(); d_regs()->window = df_handle_from_window(w); - df_window_update_and_render(scratch.arena, w); + df_window_frame(w); + MemoryZeroStruct(&w->ui_events); D_Regs *window_regs = d_pop_regs(); if(df_window_from_handle(df_state->last_focused_window) == w) { @@ -12080,14 +12104,6 @@ df_frame(void) } } - ////////////////////////////// - //- rjf: clear commands - // - { - arena_clear(df_state->cmds_arena); - MemoryZeroStruct(&df_state->cmds); - } - ////////////////////////////// //- rjf: simulate lag // diff --git a/src/dbg_frontend/dbg_frontend_core.h b/src/dbg_frontend/dbg_frontend_core.h index 4b7d187e..80c061bb 100644 --- a/src/dbg_frontend/dbg_frontend_core.h +++ b/src/dbg_frontend/dbg_frontend_core.h @@ -609,6 +609,9 @@ struct DF_Window DF_Panel *free_panel; DF_Panel *focused_panel; + // rjf: per-frame ui events state + UI_EventList ui_events; + // rjf: per-frame drawing state DR_Bucket *draw_bucket; }; @@ -894,7 +897,7 @@ internal DF_Window *df_window_open(Vec2F32 size, OS_Handle preferred_monitor, D_ internal DF_Window *df_window_from_os_handle(OS_Handle os); -internal void df_window_update_and_render(Arena *arena, DF_Window *ws); +internal void df_window_frame(DF_Window *ws); //////////////////////////////// //~ rjf: Eval Viz diff --git a/src/dbg_frontend/dbg_frontend_views.c b/src/dbg_frontend/dbg_frontend_views.c index 55f3b94d..32acb29d 100644 --- a/src/dbg_frontend/dbg_frontend_views.c +++ b/src/dbg_frontend/dbg_frontend_views.c @@ -1645,10 +1645,10 @@ df_watch_view_build(DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 d if(1 <= selection_tbl.min.y && selection_tbl.min.y <= frame_rows_count) { FrameRow *frame_row = &frame_rows[selection_tbl.min.y-1]; - d_cmd(D_CmdKind_SelectUnwind, - .entity = d_regs()->thread, - .unwind_index = frame_row->unwind_idx, - .inline_depth = frame_row->inline_depth); + df_cmd(DF_CmdKind_SelectUnwind, + .entity = d_regs()->thread, + .unwind_index = frame_row->unwind_idx, + .inline_depth = frame_row->inline_depth); } } @@ -2644,10 +2644,10 @@ df_watch_view_build(DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 d if(ui_double_clicked(sig) && !cell_can_edit && semantic_idx < frame_rows_count) { FrameRow *frame_row = &frame_rows[semantic_idx]; - d_cmd(D_CmdKind_SelectUnwind, - .entity = d_regs()->thread, - .unwind_index = frame_row->unwind_idx, - .inline_depth = frame_row->inline_depth); + df_cmd(DF_CmdKind_SelectUnwind, + .entity = d_regs()->thread, + .unwind_index = frame_row->unwind_idx, + .inline_depth = frame_row->inline_depth); } // rjf: hovering with inheritance string -> show tooltip @@ -2959,12 +2959,12 @@ DF_VIEW_UI_FUNCTION_DEF(getting_started) { if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Launch %S", target_name))) { - d_cmd(D_CmdKind_LaunchAndRun, .entity = d_handle_from_entity(target)); + df_cmd(DF_CmdKind_LaunchAndRun, .entity = d_handle_from_entity(target)); } ui_spacer(ui_em(1.5f, 1)); if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Step Into %S", target_name))) { - d_cmd(D_CmdKind_LaunchAndInit, .entity = d_handle_from_entity(target)); + df_cmd(DF_CmdKind_LaunchAndInit, .entity = d_handle_from_entity(target)); } } }break; @@ -5059,15 +5059,14 @@ DF_VIEW_UI_FUNCTION_DEF(targets) { DF_IconKind icon; String8 text; - D_CmdKind d_cmd; - DF_CmdKind df_cmd; + DF_CmdKind cmd; } ctrls[] = { - { DF_IconKind_PlayStepForward, str8_lit("Launch and Initialize"), D_CmdKind_LaunchAndInit }, - { DF_IconKind_Play, str8_lit("Launch and Run"), D_CmdKind_LaunchAndRun }, - { DF_IconKind_Pencil, str8_lit("Edit"), D_CmdKind_Null, DF_CmdKind_Target }, - { DF_IconKind_Trash, str8_lit("Delete"), D_CmdKind_Null, DF_CmdKind_RemoveTarget }, + { DF_IconKind_PlayStepForward, str8_lit("Launch and Initialize"), DF_CmdKind_LaunchAndInit }, + { DF_IconKind_Play, str8_lit("Launch and Run"), DF_CmdKind_LaunchAndRun }, + { DF_IconKind_Pencil, str8_lit("Edit"), DF_CmdKind_Target }, + { DF_IconKind_Trash, str8_lit("Delete"), DF_CmdKind_RemoveTarget }, }; for(U64 ctrl_idx = 0; ctrl_idx < ArrayCount(ctrls); ctrl_idx += 1) { @@ -5082,14 +5081,7 @@ DF_VIEW_UI_FUNCTION_DEF(targets) } if(ui_clicked(sig)) { - if(ctrls[ctrl_idx].d_cmd != D_CmdKind_Null) - { - d_cmd(ctrls[ctrl_idx].d_cmd, .entity = d_handle_from_entity(target)); - } - if(ctrls[ctrl_idx].df_cmd != DF_CmdKind_Null) - { - df_cmd(ctrls[ctrl_idx].df_cmd, .entity = d_handle_from_entity(target)); - } + df_cmd(ctrls[ctrl_idx].cmd, .entity = d_handle_from_entity(target)); } } } @@ -5646,7 +5638,7 @@ DF_VIEW_UI_FUNCTION_DEF(scheduler) if(ui_clicked(sig)) { D_CmdKind cmd_kind = frozen ? D_CmdKind_ThawEntity : D_CmdKind_FreezeEntity; - d_cmd(cmd_kind, .entity = d_handle_from_entity(entity)); + df_cmd(cmd_kind, .entity = d_handle_from_entity(entity)); } } UI_TableCellSized(ui_pct(1, 0)) @@ -5669,14 +5661,14 @@ DF_VIEW_UI_FUNCTION_DEF(scheduler) UI_TextAlignment(UI_TextAlign_Center) if(ui_clicked(ui_buttonf("Detach"))) { - d_cmd(D_CmdKind_Detach, .entity = d_handle_from_entity(entity)); + df_cmd(D_CmdKind_Detach, .entity = d_handle_from_entity(entity)); } } UI_TableCellSized(ui_em(2.25f, 1.f)) UI_FocusHot((row_is_selected && cursor.x == 3) ? UI_FocusKind_On : UI_FocusKind_Off) { if(ui_clicked(df_icon_buttonf(DF_IconKind_Redo, 0, "###retry"))) { - d_cmd(D_CmdKind_Restart, .entity = d_handle_from_entity(entity)); + df_cmd(D_CmdKind_Restart, .entity = d_handle_from_entity(entity)); } } UI_TableCellSized(ui_em(2.25f, 1.f)) UI_FocusHot((row_is_selected && cursor.x == 4) ? UI_FocusKind_On : UI_FocusKind_Off) @@ -5684,7 +5676,7 @@ DF_VIEW_UI_FUNCTION_DEF(scheduler) DF_Palette(DF_PaletteCode_NegativePopButton) if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "###kill"))) { - d_cmd(D_CmdKind_Kill, .entity = d_handle_from_entity(entity)); + df_cmd(D_CmdKind_Kill, .entity = d_handle_from_entity(entity)); } } }break; @@ -6316,7 +6308,7 @@ DF_VIEW_CMD_FUNCTION_DEF(pending_file) for(D_CmdNode *cmd_node = pves->deferred_cmds.first; cmd_node != 0; cmd_node = cmd_node->next) { D_Cmd *cmd = &cmd_node->cmd; - d_push_cmd(cmd->spec, &cmd->params); + df_push_cmd(cmd->spec, &cmd->params); } arena_clear(pves->deferred_cmd_arena); MemoryZeroStruct(&pves->deferred_cmds); diff --git a/src/dbg_frontend/dbg_frontend_widgets.c b/src/dbg_frontend/dbg_frontend_widgets.c index e47c0743..1bd0a11d 100644 --- a/src/dbg_frontend/dbg_frontend_widgets.c +++ b/src/dbg_frontend/dbg_frontend_widgets.c @@ -1312,7 +1312,7 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe // rjf: double click => select if(ui_double_clicked(thread_sig)) { - d_cmd(D_CmdKind_SelectThread, .entity = d_handle_from_entity(thread)); + df_cmd(DF_CmdKind_SelectThread, .entity = d_handle_from_entity(thread)); ui_kill_action(); } @@ -1899,7 +1899,7 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe } } } - d_cmd(D_CmdKind_SetThreadIP, .entity = d_handle_from_entity(dropped_entity), .vaddr = new_rip_vaddr); + df_cmd(DF_CmdKind_SetThreadIP, .entity = d_handle_from_entity(dropped_entity), .vaddr = new_rip_vaddr); }break; } } diff --git a/src/dbg_frontend/generated/dbg_frontend.meta.c b/src/dbg_frontend/generated/dbg_frontend.meta.c index 5e366897..4fd9e4a6 100644 --- a/src/dbg_frontend/generated/dbg_frontend.meta.c +++ b/src/dbg_frontend/generated/dbg_frontend.meta.c @@ -28,9 +28,46 @@ DF_CmdKind_Null, DF_CmdKind_Null, }; -D_CmdSpecInfo df_cmd_kind_spec_info_table[183] = +D_CmdSpecInfo df_cmd_kind_spec_info_table[220] = { -{ str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), (D_CmdSpecFlag_ListInUI*0)|(D_CmdSpecFlag_ListInIPCDocs*0), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{0}, +{ str8_lit_comp("launch_and_run"), str8_lit_comp("Starts debugging a new instance of a target, then runs."), str8_lit_comp("launch,start,run,target"), str8_lit_comp("Launch and Run"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_EntityList, D_EntityKind_Target, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, +{ str8_lit_comp("launch_and_init"), str8_lit_comp("Starts debugging a new instance of a target, then stops at the program's entry point."), str8_lit_comp("launch,start,entry,point"), str8_lit_comp("Launch and Initialize"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_EntityList, D_EntityKind_Target, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, +{ str8_lit_comp("kill"), str8_lit_comp("Kills the specified existing debugged process(es)."), str8_lit_comp("stop,kill"), str8_lit_comp("Kill"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_EntityList, D_EntityKind_Process, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, +{ str8_lit_comp("kill_all"), str8_lit_comp("Kills all debugged child processes."), str8_lit_comp("stop,kill,all"), str8_lit_comp("Kill All"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("detach"), str8_lit_comp("Detaches the specified debugged process."), str8_lit_comp("detach"), str8_lit_comp("Detach"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_EntityList, D_EntityKind_Process, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, +{ str8_lit_comp("continue"), str8_lit_comp("Continues all halted threads."), str8_lit_comp(""), str8_lit_comp("Continue"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("step_into_inst"), str8_lit_comp("Performs a step that goes into calls, at the instruction level."), str8_lit_comp("single,step,thread"), str8_lit_comp("Step Into (Assembly)"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("step_over_inst"), str8_lit_comp("Performs a step that skips calls, at the instruction level."), str8_lit_comp("single,step,thread"), str8_lit_comp("Step Over (Assembly)"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("step_into_line"), str8_lit_comp("Performs a step that goes into calls, at the source code line level."), str8_lit_comp("step,thread"), str8_lit_comp("Step Into (Line)"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("step_over_line"), str8_lit_comp("Performs a step that skips calls, at the source code line level."), str8_lit_comp("step,thread"), str8_lit_comp("Step Over (Line)"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("step_out"), str8_lit_comp("Runs to the end of the current function and exits it."), str8_lit_comp(""), str8_lit_comp("Step Out"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("halt"), str8_lit_comp("Halts all running processes."), str8_lit_comp("pause"), str8_lit_comp("Halt"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("soft_halt_refresh"), str8_lit_comp("Interrupts all running processes to collect data, and then resumes them."), str8_lit_comp(""), str8_lit_comp("Soft Halt Refresh"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("set_thread_ip"), str8_lit_comp("Sets the passed thread's instruction pointer at the passed address."), str8_lit_comp(""), str8_lit_comp("Set Thread IP"), (D_CmdSpecFlag_ListInUI*0)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_VirtualAddr, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*1)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, +{ str8_lit_comp("run_to_line"), str8_lit_comp("Runs until a particular source line is hit."), str8_lit_comp(""), str8_lit_comp("Run To Line"), (D_CmdSpecFlag_ListInUI*0)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("run_to_address"), str8_lit_comp("Runs until a particular address is hit."), str8_lit_comp(""), str8_lit_comp("Run To Address"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_VirtualAddr, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*1)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, +{ str8_lit_comp("run"), str8_lit_comp("Runs all targets after starting them if they have not been started yet."), str8_lit_comp("play"), str8_lit_comp("Run"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("restart"), str8_lit_comp("Kills all running processes, then restarts the targets which were used to launch all current processes (if any)."), str8_lit_comp("restart,retry"), str8_lit_comp("Restart"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("step_into"), str8_lit_comp("Steps once, possibly into function calls, for either line or instructions."), str8_lit_comp(""), str8_lit_comp("Step Into"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("step_over"), str8_lit_comp("Steps once, always over function calls, for either line or instructions."), str8_lit_comp(""), str8_lit_comp("Step Over"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("run_to_cursor"), str8_lit_comp("Runs the selected thread to the current cursor."), str8_lit_comp("line"), str8_lit_comp("Run To Cursor"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("set_next_statement"), str8_lit_comp("Sets the selected thread's instruction pointer to the cursor's position."), str8_lit_comp(""), str8_lit_comp("Set Next Statement"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("select_thread"), str8_lit_comp("Selects a thread."), str8_lit_comp(""), str8_lit_comp("Select Thread"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Entity, D_EntityKind_Thread, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, +{ str8_lit_comp("select_unwind"), str8_lit_comp("Selects an unwind frame number for the selected thread."), str8_lit_comp(""), str8_lit_comp("Select Unwind"), (D_CmdSpecFlag_ListInUI*0)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("up_one_frame"), str8_lit_comp("Selects the call stack frame above the currently selected."), str8_lit_comp(""), str8_lit_comp("Up One Frame"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("down_one_frame"), str8_lit_comp("Selects the call stack frame below the currently selected."), str8_lit_comp("callstack,unwind"), str8_lit_comp("Down One Frame"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("freeze_thread"), str8_lit_comp("Freezes the passed thread."), str8_lit_comp("callstack,unwind"), str8_lit_comp("Freeze Thread"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Entity, D_EntityKind_Thread, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, +{ str8_lit_comp("thaw_thread"), str8_lit_comp("Thaws the passed thread."), str8_lit_comp(""), str8_lit_comp("Thaw Thread"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Entity, D_EntityKind_Thread, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, +{ str8_lit_comp("freeze_process"), str8_lit_comp("Freezes the passed process."), str8_lit_comp(""), str8_lit_comp("Freeze Process"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Entity, D_EntityKind_Process, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, +{ str8_lit_comp("thaw_process"), str8_lit_comp("Thaws the passed process."), str8_lit_comp(""), str8_lit_comp("Thaw Process"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Entity, D_EntityKind_Process, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, +{ str8_lit_comp("freeze_machine"), str8_lit_comp("Freezes the passed machine."), str8_lit_comp(""), str8_lit_comp("Freeze Machine"), (D_CmdSpecFlag_ListInUI*0)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Entity, D_EntityKind_Machine, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, +{ str8_lit_comp("thaw_machine"), str8_lit_comp("Thaws the passed machine."), str8_lit_comp(""), str8_lit_comp("Thaw Machine"), (D_CmdSpecFlag_ListInUI*0)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Entity, D_EntityKind_Machine, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, +{ str8_lit_comp("freeze_local_machine"), str8_lit_comp("Freezes the local machine."), str8_lit_comp(""), str8_lit_comp("Freeze Local Machine"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("thaw_local_machine"), str8_lit_comp("Thaws the local machine."), str8_lit_comp(""), str8_lit_comp("Thaw Local Machine"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("freeze_entity"), str8_lit_comp("Freezes an entity."), str8_lit_comp(""), str8_lit_comp("Freeze Entity"), (D_CmdSpecFlag_ListInUI*0)|(D_CmdSpecFlag_ListInIPCDocs*0), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("thaw_entity"), str8_lit_comp("Thaws an entity."), str8_lit_comp(""), str8_lit_comp("Thaw Entity"), (D_CmdSpecFlag_ListInUI*0)|(D_CmdSpecFlag_ListInIPCDocs*0), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, +{ str8_lit_comp("attach"), str8_lit_comp("Attaches to a process that is already running on the local machine."), str8_lit_comp(""), str8_lit_comp("Attach"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_ID, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, { str8_lit_comp("exit"), str8_lit_comp("Exits the debugger."), str8_lit_comp("quit,close,abort"), str8_lit_comp("Exit"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, { str8_lit_comp("run_command"), str8_lit_comp("Runs a command from the command palette."), str8_lit_comp("help,cmd"), str8_lit_comp("Run Command"), (D_CmdSpecFlag_ListInUI*1)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_CmdSpec, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*1)}}, { str8_lit_comp("error"), str8_lit_comp("Notifies of an error."), str8_lit_comp(""), str8_lit_comp("Error"), (D_CmdSpecFlag_ListInUI*0)|(D_CmdSpecFlag_ListInIPCDocs*1), {D_CmdParamSlot_Null, D_EntityKind_Nil, (D_CmdQueryFlag_AllowFiles*0)|(D_CmdQueryFlag_AllowFolders*0)|(D_CmdQueryFlag_CodeInput*0)|(D_CmdQueryFlag_KeepOldInput*0)|(D_CmdQueryFlag_SelectOldInput*0)|(D_CmdQueryFlag_Required*0)}}, @@ -500,9 +537,46 @@ DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[34] = {(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|1*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("settings"), str8_lit_comp("Settings"), DF_IconKind_Gear, DF_VIEW_SETUP_FUNCTION_NAME(settings), DF_VIEW_CMD_FUNCTION_NAME(settings), DF_VIEW_UI_FUNCTION_NAME(settings)}, }; -DF_IconKind df_cmd_kind_icon_kind_table[183] = +DF_IconKind df_cmd_kind_icon_kind_table[220] = { DF_IconKind_Null, +DF_IconKind_Play, +DF_IconKind_PlayStepForward, +DF_IconKind_Stop, +DF_IconKind_Stop, +DF_IconKind_Null, +DF_IconKind_Play, +DF_IconKind_StepInto, +DF_IconKind_StepOver, +DF_IconKind_StepInto, +DF_IconKind_StepOver, +DF_IconKind_StepOut, +DF_IconKind_Pause, +DF_IconKind_Refresh, +DF_IconKind_Null, +DF_IconKind_Play, +DF_IconKind_PlayStepForward, +DF_IconKind_Play, +DF_IconKind_Redo, +DF_IconKind_StepInto, +DF_IconKind_StepOver, +DF_IconKind_Play, +DF_IconKind_RightArrow, +DF_IconKind_Null, +DF_IconKind_Null, +DF_IconKind_UpArrow, +DF_IconKind_DownArrow, +DF_IconKind_Locked, +DF_IconKind_Unlocked, +DF_IconKind_Locked, +DF_IconKind_Unlocked, +DF_IconKind_Locked, +DF_IconKind_Unlocked, +DF_IconKind_Machine, +DF_IconKind_Machine, +DF_IconKind_Null, +DF_IconKind_Null, +DF_IconKind_Null, DF_IconKind_X, DF_IconKind_Null, DF_IconKind_Null, diff --git a/src/dbg_frontend/generated/dbg_frontend.meta.h b/src/dbg_frontend/generated/dbg_frontend.meta.h index 7da3ea5a..64d7f041 100644 --- a/src/dbg_frontend/generated/dbg_frontend.meta.h +++ b/src/dbg_frontend/generated/dbg_frontend.meta.h @@ -9,6 +9,43 @@ typedef enum DF_CmdKind { DF_CmdKind_Null, +DF_CmdKind_LaunchAndRun, +DF_CmdKind_LaunchAndInit, +DF_CmdKind_Kill, +DF_CmdKind_KillAll, +DF_CmdKind_Detach, +DF_CmdKind_Continue, +DF_CmdKind_StepIntoInst, +DF_CmdKind_StepOverInst, +DF_CmdKind_StepIntoLine, +DF_CmdKind_StepOverLine, +DF_CmdKind_StepOut, +DF_CmdKind_Halt, +DF_CmdKind_SoftHaltRefresh, +DF_CmdKind_SetThreadIP, +DF_CmdKind_RunToLine, +DF_CmdKind_RunToAddress, +DF_CmdKind_Run, +DF_CmdKind_Restart, +DF_CmdKind_StepInto, +DF_CmdKind_StepOver, +DF_CmdKind_RunToCursor, +DF_CmdKind_SetNextStatement, +DF_CmdKind_SelectThread, +DF_CmdKind_SelectUnwind, +DF_CmdKind_UpOneFrame, +DF_CmdKind_DownOneFrame, +DF_CmdKind_FreezeThread, +DF_CmdKind_ThawThread, +DF_CmdKind_FreezeProcess, +DF_CmdKind_ThawProcess, +DF_CmdKind_FreezeMachine, +DF_CmdKind_ThawMachine, +DF_CmdKind_FreezeLocalMachine, +DF_CmdKind_ThawLocalMachine, +DF_CmdKind_FreezeEntity, +DF_CmdKind_ThawEntity, +DF_CmdKind_Attach, DF_CmdKind_Exit, DF_CmdKind_RunCommand, DF_CmdKind_Error, @@ -550,7 +587,7 @@ extern String8 df_g_binding_version_remap_new_name_table[7]; extern String8 df_g_icon_kind_text_table[69]; extern String8 df_view_kind_name_lower_table[34]; extern DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[34]; -extern DF_IconKind df_cmd_kind_icon_kind_table[183]; +extern DF_IconKind df_cmd_kind_icon_kind_table[220]; extern DF_IconKind df_entity_kind_icon_kind_table[30]; extern D_CmdParamSlot df_g_cmd_param_slot_2_view_spec_src_map[7]; extern String8 df_g_cmd_param_slot_2_view_spec_dst_map[7]; diff --git a/src/raddbg/raddbg_main.c b/src/raddbg/raddbg_main.c index f6ba2fa7..5ac7fd77 100644 --- a/src/raddbg/raddbg_main.c +++ b/src/raddbg/raddbg_main.c @@ -920,7 +920,7 @@ entry_point(CmdLine *cmd_line) String8 error = d_cmd_params_apply_spec_query(scratch.arena, ¶ms, cmd_spec, d_cmd_arg_part_from_string(msg)); if(error.size == 0) { - d_push_cmd(cmd_spec, ¶ms); + df_push_cmd(cmd_spec, ¶ms); df_request_frame(); } else @@ -946,21 +946,21 @@ entry_point(CmdLine *cmd_line) if(auto_run) { auto_run = 0; - d_cmd(D_CmdKind_LaunchAndRun); + df_cmd(DF_CmdKind_LaunchAndRun); } //- rjf: auto step if(auto_step) { auto_step = 0; - d_cmd(D_CmdKind_StepInto); + df_cmd(DF_CmdKind_StepInto); } //- rjf: jit attach if(jit_attach) { jit_attach = 0; - d_cmd(D_CmdKind_Attach, .id = jit_pid); + df_cmd(DF_CmdKind_Attach, .id = jit_pid); } } }