From 3641c212b23a2eca540d06e9c5adac55883b6a65 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Thu, 12 Sep 2024 14:58:48 -0700 Subject: [PATCH] begin floating thread/frame selection mechanisms into frontend and out of engine --- src/dbg_engine/dbg_engine.mdesk | 6 - src/dbg_engine/dbg_engine_core.c | 224 +++++------------- src/dbg_engine/dbg_engine_core.h | 45 +++- src/dbg_engine/generated/dbg_engine.meta.h | 6 - src/dbg_frontend/dbg_frontend.mdesk | 11 +- src/dbg_frontend/dbg_frontend_core.c | 155 +++++++++++- src/dbg_frontend/dbg_frontend_core.h | 3 - .../generated/dbg_frontend.meta.c | 15 +- .../generated/dbg_frontend.meta.h | 13 +- 9 files changed, 282 insertions(+), 196 deletions(-) diff --git a/src/dbg_engine/dbg_engine.mdesk b/src/dbg_engine/dbg_engine.mdesk index d115fbd6..aeb7d7b6 100644 --- a/src/dbg_engine/dbg_engine.mdesk +++ b/src/dbg_engine/dbg_engine.mdesk @@ -252,14 +252,8 @@ D_CmdTable: // | | | | {Restart 1 1 Null null Nil 0 0 0 0 0 0 Redo "restart" "Restart" "Kills all running processes, then restarts the targets which were used to launch all current processes (if any)." "restart,retry" } {StepInto 1 1 Null null Nil 0 0 0 0 0 0 StepInto "step_into" "Step Into" "Steps once, possibly into function calls, for either line or instructions." "" } {StepOver 1 1 Null null Nil 0 0 0 0 0 0 StepOver "step_over" "Step Over" "Steps once, always over function calls, for either line or instructions." "" } - {RunToCursor 1 1 Null null Nil 0 0 0 0 0 0 Play "run_to_cursor" "Run To Cursor" "Runs the selected thread to the current cursor." "line" } - {SetNextStatement 1 1 Null null Nil 0 0 0 0 0 0 RightArrow "set_next_statement" "Set Next Statement" "Sets the selected thread's instruction pointer to the cursor's position." "" } //- rjf: debug control context management operations - {SelectThread 1 1 Entity null Thread 0 0 0 0 0 1 Null "select_thread" "Select Thread" "Selects a thread." "" } - {SelectUnwind 0 1 Null null Nil 0 0 0 0 0 0 Null "select_unwind" "Select Unwind" "Selects an unwind frame number for the selected thread." "" } - {UpOneFrame 1 1 Null null Nil 0 0 0 0 0 0 UpArrow "up_one_frame" "Up One Frame" "Selects the call stack frame above the currently selected." "" } - {DownOneFrame 1 1 Null null Nil 0 0 0 0 0 0 DownArrow "down_one_frame" "Down One Frame" "Selects the call stack frame below the currently selected." "callstack,unwind" } {FreezeThread 1 1 Entity null Thread 0 0 0 0 0 1 Locked "freeze_thread" "Freeze Thread" "Freezes the passed thread." "callstack,unwind" } {ThawThread 1 1 Entity null Thread 0 0 0 0 0 1 Unlocked "thaw_thread" "Thaw Thread" "Thaws the passed thread." "" } {FreezeProcess 1 1 Entity null Process 0 0 0 0 0 1 Locked "freeze_process" "Freeze Process" "Freezes the passed process." "" } diff --git a/src/dbg_engine/dbg_engine_core.c b/src/dbg_engine/dbg_engine_core.c index 6350f5de..8de67797 100644 --- a/src/dbg_engine/dbg_engine_core.c +++ b/src/dbg_engine/dbg_engine_core.c @@ -3859,12 +3859,12 @@ d_init(void) d_state->ctrl_last_run_arena = arena_alloc(); } -internal CTRL_EventList +internal D_EventList d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints) { ProfBeginFunction(); Temp scratch = scratch_begin(&arena, 1); - CTRL_EventList result = {0}; + D_EventList result = {0}; d_state->frame_index += 1; arena_clear(d_frame_arena()); d_state->frame_eval_memread_endt_us = os_now_microseconds() + 5000; @@ -3881,9 +3881,9 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints) U64 new_reg_gen = ctrl_reg_gen(); //- rjf: consume & process events - result = ctrl_c2u_pop_events(arena); - ctrl_entity_store_apply_events(d_state->ctrl_entity_store, &result); - for(CTRL_EventNode *event_n = result.first; + CTRL_EventList events = ctrl_c2u_pop_events(scratch.arena); + ctrl_entity_store_apply_events(d_state->ctrl_entity_store, &events); + for(CTRL_EventNode *event_n = events.first; event_n != 0; event_n = event_n->next) { @@ -3914,7 +3914,30 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints) B32 should_snap = !(d_state->ctrl_soft_halt_issued); d_state->ctrl_is_running = 0; d_state->ctrl_soft_halt_issued = 0; - D_Entity *stop_thread = d_entity_from_ctrl_handle(event->entity); + + // rjf: exception or unexpected trap -> push error + if(event->cause == CTRL_EventCause_InterruptedByException || + event->cause == CTRL_EventCause_InterruptedByTrap) + { + log_user_error(str8_zero()); + } + + // rjf: kill all entities which are marked to die on stop + { + D_Entity *request = d_entity_from_id(event->msg_id); + if(d_entity_is_nil(request)) + { + for(D_Entity *entity = d_entity_root(); + !d_entity_is_nil(entity); + entity = d_entity_rec_depth_first_pre(entity, d_entity_root()).next) + { + if(entity->flags & D_EntityFlag_DiesOnRunStop) + { + d_entity_mark_for_deletion(entity); + } + } + } + } // rjf: gather stop info { @@ -3923,6 +3946,26 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints) d_state->ctrl_last_stop_event.string = push_str8_copy(d_state->ctrl_stop_arena, d_state->ctrl_last_stop_event.string); } + // rjf: push stop event to caller, if this is not a soft-halt + if(should_snap) + { + D_EventCause cause = D_EventCause_Null; + switch(event->cause) + { + default:{}break; + case CTRL_EventCause_UserBreakpoint:{cause = D_EventCause_UserBreakpoint;}break; + } + D_EventNode *n = push_array(arena, D_EventNode, 1); + SLLQueuePush(result.first, result.last, n); + result.count += 1; + D_Event *evt = &n->v; + evt->kind = D_EventKind_Stop; + evt->cause = cause; + evt->vaddr = event->rip_vaddr; + } + +#if 0 // TODO(rjf): @msgs + D_Entity *stop_thread = d_entity_from_ctrl_handle(event->entity); // rjf: select & snap to thread causing stop if(should_snap && stop_thread->kind == D_EntityKind_Thread) { @@ -3931,7 +3974,6 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints) } // rjf: if no stop-causing thread, and if selected thread, snap to selected -#if 0 // TODO(rjf): @msgs if(should_snap && d_entity_is_nil(stop_thread)) { D_Entity *selected_thread = d_entity_from_handle(d_regs()->thread); @@ -3940,7 +3982,6 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints) df_cmd(DF_CmdKind_FindThread, .thread = d_handle_from_entity(selected_thread)); } } -#endif // rjf: thread hit user breakpoint -> increment breakpoint hit count if(should_snap && event->cause == CTRL_EventCause_UserBreakpoint) @@ -3981,30 +4022,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints) } } } - - // rjf: exception or unexpected trap -> push error - if(event->cause == CTRL_EventCause_InterruptedByException || - event->cause == CTRL_EventCause_InterruptedByTrap) - { - log_user_error(str8_zero()); - } - - // rjf: kill all entities which are marked to die on stop - { - D_Entity *request = d_entity_from_id(event->msg_id); - if(d_entity_is_nil(request)) - { - for(D_Entity *entity = d_entity_root(); - !d_entity_is_nil(entity); - entity = d_entity_rec_depth_first_pre(entity, d_entity_root()).next) - { - if(entity->flags & D_EntityFlag_DiesOnRunStop) - { - d_entity_mark_for_deletion(entity); - } - } - } - } +#endif }break; //- rjf: entity creation/deletion @@ -4096,6 +4114,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints) // rjf: equip color d_entity_equip_color_rgba(entity, thread_color); +#if 0 // TODO(rjf): @msgs // rjf: automatically select if we don't have a selected thread D_Entity *selected_thread = d_entity_from_handle(d_state->base_regs.v.thread); if(d_entity_is_nil(selected_thread)) @@ -4110,6 +4129,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints) { d_cmd(D_CmdKind_SelectThread, .entity = d_handle_from_entity(entity)); } +#endif }break; case CTRL_EventKind_NewModule: @@ -4673,15 +4693,13 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints) ctrl_halt(); }break; case D_CmdKind_SoftHaltRefresh: + if(d_ctrl_targets_running()) { - if(d_ctrl_targets_running()) - { - need_run = 1; - run_kind = d_state->ctrl_last_run_kind; - run_thread = ctrl_entity_from_handle(d_state->ctrl_entity_store, d_state->ctrl_last_run_thread_handle); - run_flags = d_state->ctrl_last_run_flags; - run_traps = d_state->ctrl_last_run_traps; - } + need_run = 1; + run_kind = d_state->ctrl_last_run_kind; + run_thread = ctrl_entity_from_handle(d_state->ctrl_entity_store, d_state->ctrl_last_run_thread_handle); + run_flags = d_state->ctrl_last_run_flags; + run_traps = d_state->ctrl_last_run_traps; }break; case D_CmdKind_SetThreadIP: { @@ -4776,7 +4794,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints) case D_CmdKind_StepInto: case D_CmdKind_StepOver: { - D_EntityList processes = d_query_cached_entity_list_with_kind(D_EntityKind_Process); + CTRL_EntityList processes = ctrl_entity_list_from_kind(d_state->ctrl_entity_store, CTRL_EntityKind_Process); if(processes.count != 0) { D_CmdKind step_cmd_kind = (cmd->kind == D_CmdKind_StepInto @@ -4797,127 +4815,8 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints) d_cmd(D_CmdKind_LaunchAndInit, .entity_list = d_handle_list_from_entity_list(scratch.arena, targets)); } }break; - case D_CmdKind_RunToCursor: - { - String8 file_path = d_regs()->file_path; - if(file_path.size != 0) - { - d_cmd(D_CmdKind_RunToLine, .file_path = file_path, .text_point = d_regs()->cursor); - } - else - { - d_cmd(D_CmdKind_RunToAddress, .vaddr = d_regs()->vaddr_range.min); - } - }break; - case D_CmdKind_SetNextStatement: - { - D_Entity *thread = d_entity_from_handle(d_regs()->thread); - String8 file_path = d_regs()->file_path; - U64 new_rip_vaddr = d_regs()->vaddr_range.min; - if(file_path.size != 0) - { - D_LineList *lines = &d_regs()->lines; - for(D_LineNode *n = lines->first; n != 0; n = n->next) - { - D_EntityList modules = d_modules_from_dbgi_key(scratch.arena, &n->v.dbgi_key); - D_Entity *module = d_module_from_thread_candidates(thread, &modules); - if(!d_entity_is_nil(module)) - { - new_rip_vaddr = d_vaddr_from_voff(module, n->v.voff_range.min); - break; - } - } - } - d_cmd(D_CmdKind_SetThreadIP, .entity = d_handle_from_entity(thread), .vaddr = new_rip_vaddr); - }break; - //- rjf: debug control context management operations - case D_CmdKind_SelectThread: - { - D_Entity *thread = d_entity_from_handle(params.entity); - D_Entity *module = d_module_from_thread(thread); - D_Entity *process = d_entity_ancestor_from_kind(thread, D_EntityKind_Process); - d_state->base_regs.v.unwind_count = 0; - d_state->base_regs.v.inline_depth = 0; - d_state->base_regs.v.thread = d_handle_from_entity(thread); - d_state->base_regs.v.module = d_handle_from_entity(module); - d_state->base_regs.v.process = d_handle_from_entity(process); -#if 0 // TODO(rjf): @msgs - df_cmd(DF_CmdKind_FindThread, .thread = d_handle_from_entity(thread)); -#endif - }break; - case D_CmdKind_SelectUnwind: - { - DI_Scope *di_scope = di_scope_open(); - D_Entity *thread = d_entity_from_handle(d_state->base_regs.v.thread); - D_Entity *process = d_entity_ancestor_from_kind(thread, D_EntityKind_Process); - CTRL_Unwind base_unwind = d_query_cached_unwind_from_thread(thread); - D_Unwind rich_unwind = d_unwind_from_ctrl_unwind(scratch.arena, di_scope, process, &base_unwind); - if(params.unwind_index < rich_unwind.frames.concrete_frame_count) - { - D_UnwindFrame *frame = &rich_unwind.frames.v[params.unwind_index]; - d_state->base_regs.v.unwind_count = params.unwind_index; - d_state->base_regs.v.inline_depth = 0; - if(params.inline_depth <= frame->inline_frame_count) - { - d_state->base_regs.v.inline_depth = params.inline_depth; - } - } -#if 0 // TODO(rjf): @msgs - df_cmd(DF_CmdKind_FindThread, .thread = d_handle_from_entity(thread)); -#endif - di_scope_close(di_scope); - }break; - case D_CmdKind_UpOneFrame: - case D_CmdKind_DownOneFrame: - { - DI_Scope *di_scope = di_scope_open(); - D_Entity *thread = d_entity_from_handle(d_state->base_regs.v.thread); - D_Entity *process = d_entity_ancestor_from_kind(thread, D_EntityKind_Process); - CTRL_Unwind base_unwind = d_query_cached_unwind_from_thread(thread); - D_Unwind rich_unwind = d_unwind_from_ctrl_unwind(scratch.arena, di_scope, process, &base_unwind); - U64 crnt_unwind_idx = d_state->base_regs.v.unwind_count; - U64 crnt_inline_dpt = d_state->base_regs.v.inline_depth; - U64 next_unwind_idx = crnt_unwind_idx; - U64 next_inline_dpt = crnt_inline_dpt; - if(crnt_unwind_idx < rich_unwind.frames.concrete_frame_count) - { - D_UnwindFrame *f = &rich_unwind.frames.v[crnt_unwind_idx]; - switch(cmd->kind) - { - default:{}break; - case D_CmdKind_UpOneFrame: - { - if(crnt_inline_dpt < f->inline_frame_count) - { - next_inline_dpt += 1; - } - else if(crnt_unwind_idx > 0) - { - next_unwind_idx -= 1; - next_inline_dpt = 0; - } - }break; - case D_CmdKind_DownOneFrame: - { - if(crnt_inline_dpt > 0) - { - next_inline_dpt -= 1; - } - else if(crnt_unwind_idx < rich_unwind.frames.concrete_frame_count) - { - next_unwind_idx += 1; - next_inline_dpt = (f+1)->inline_frame_count; - } - }break; - } - } - d_cmd(D_CmdKind_SelectUnwind, - .unwind_index = next_unwind_idx, - .inline_depth = next_inline_dpt); - di_scope_close(di_scope); - }break; case D_CmdKind_FreezeThread: case D_CmdKind_ThawThread: case D_CmdKind_FreezeProcess: @@ -5068,6 +4967,11 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints) ctrl_msg_list_concat_in_place(&d_state->ctrl_msgs, &msgs_copy); if(d_state->ctrl_msgs.count != 0) { + if(!d_state->ctrl_soft_halt_issued && d_state->ctrl_is_running) + { + d_state->ctrl_soft_halt_issued = 1; + ctrl_halt(); + } if(ctrl_u2c_push_msgs(&d_state->ctrl_msgs, os_now_microseconds()+100)) { MemoryZeroStruct(&d_state->ctrl_msgs); diff --git a/src/dbg_engine/dbg_engine_core.h b/src/dbg_engine/dbg_engine_core.h index 5c18daa3..91ab00cd 100644 --- a/src/dbg_engine/dbg_engine_core.h +++ b/src/dbg_engine/dbg_engine_core.h @@ -41,6 +41,49 @@ struct D_BreakpointArray U64 count; }; +//////////////////////////////// +//~ rjf: Tick Output Types + +typedef enum D_EventKind +{ + D_EventKind_Null, + D_EventKind_Stop, + D_EventKind_COUNT +} +D_EventKind; + +typedef enum D_EventCause +{ + D_EventCause_Null, + D_EventCause_UserBreakpoint, + D_EventCause_COUNT +} +D_EventCause; + +typedef struct D_Event D_Event; +struct D_Event +{ + D_EventKind kind; + D_EventCause cause; + CTRL_Handle thread; + U64 vaddr; +}; + +typedef struct D_EventNode D_EventNode; +struct D_EventNode +{ + D_EventNode *next; + D_Event v; +}; + +typedef struct D_EventList D_EventList; +struct D_EventList +{ + D_EventNode *first; + D_EventNode *last; + U64 count; +}; + //////////////////////////////// //~ rjf: Handles @@ -1046,6 +1089,6 @@ internal B32 d_next_cmd(D_Cmd **cmd); //~ rjf: Main Layer Top-Level Calls internal void d_init(void); -internal CTRL_EventList d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints); +internal D_EventList d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints); #endif // DBG_ENGINE_CORE_H diff --git a/src/dbg_engine/generated/dbg_engine.meta.h b/src/dbg_engine/generated/dbg_engine.meta.h index fe2a012a..dc383352 100644 --- a/src/dbg_engine/generated/dbg_engine.meta.h +++ b/src/dbg_engine/generated/dbg_engine.meta.h @@ -107,12 +107,6 @@ D_CmdKind_Run, D_CmdKind_Restart, D_CmdKind_StepInto, D_CmdKind_StepOver, -D_CmdKind_RunToCursor, -D_CmdKind_SetNextStatement, -D_CmdKind_SelectThread, -D_CmdKind_SelectUnwind, -D_CmdKind_UpOneFrame, -D_CmdKind_DownOneFrame, D_CmdKind_FreezeThread, D_CmdKind_ThawThread, D_CmdKind_FreezeProcess, diff --git a/src/dbg_frontend/dbg_frontend.mdesk b/src/dbg_frontend/dbg_frontend.mdesk index aad12d06..3373534f 100644 --- a/src/dbg_frontend/dbg_frontend.mdesk +++ b/src/dbg_frontend/dbg_frontend.mdesk @@ -113,12 +113,15 @@ DF_CmdTable: // | | | | //- rjf: command runner {RunCommand 1 1 String commands Nil 0 0 0 0 0 1 Null "run_command" "Run Command" "Runs a command from the command palette." "help,cmd" } - //- rjf: notifications - {Error 0 1 Null null Nil 0 0 0 0 0 0 Null "error" "Error" "Notifies of an error." "" } - //- rjf: os event passthrough {OSEvent 0 0 Null null Nil 0 0 0 0 0 0 Null "os_event" "OS Event" "" "" } + //- rjf: thread/frame selection + {SelectThread 1 1 Entity null Thread 0 0 0 0 0 1 Null "select_thread" "Select Thread" "Selects a thread." "" } + {SelectUnwind 0 1 Null null Nil 0 0 0 0 0 0 Null "select_unwind" "Select Unwind" "Selects an unwind frame number for the selected thread." "" } + {UpOneFrame 1 1 Null null Nil 0 0 0 0 0 0 UpArrow "up_one_frame" "Up One Frame" "Selects the call stack frame above the currently selected." "" } + {DownOneFrame 1 1 Null null Nil 0 0 0 0 0 0 DownArrow "down_one_frame" "Down One Frame" "Selects the call stack frame below the currently selected." "callstack,unwind" } + //- rjf: font sizes {IncUIFontScale 1 1 Null null Nil 0 0 0 0 0 0 Null "inc_ui_font_scale" "Increase UI Font Scale" "Increases the font size used for UI." "" } {DecUIFontScale 1 1 Null null Nil 0 0 0 0 0 0 Null "dec_ui_font_scale" "Decrease UI Font Scale" "Decreases the font size used for UI." "" } @@ -310,6 +313,8 @@ DF_CmdTable: // | | | | //- rjf: cursor operations {ToggleBreakpointAtCursor 1 1 Null null Nil 0 0 0 0 0 0 CircleFilled "toggle_breakpoint_cursor" "Toggle Breakpoint At Cursor" "Places or removes a breakpoint on the line on which the active cursor sits." "" } {ToggleWatchPinAtCursor 1 1 String null Nil 0 0 0 0 1 1 Binoculars "toggle_watch_pin_at_cursor" "Toggle Watch Pin At Cursor" "Places or removes a watch pin at the cursor on the currently active file." "" } + {RunToCursor 1 1 Null null Nil 0 0 0 0 0 0 Play "run_to_cursor" "Run To Cursor" "Runs the selected thread to the current cursor." "line" } + {SetNextStatement 1 1 Null null Nil 0 0 0 0 0 0 RightArrow "set_next_statement" "Set Next Statement" "Sets the selected thread's instruction pointer to the cursor's position." "" } //- rjf: targets {AddTarget 1 1 FilePath null Nil 1 0 0 0 0 1 Target "add_target" "Add Target" "Adds a new target." "application,executable,debug" } diff --git a/src/dbg_frontend/dbg_frontend_core.c b/src/dbg_frontend/dbg_frontend_core.c index dab2401b..3daf50cb 100644 --- a/src/dbg_frontend/dbg_frontend_core.c +++ b/src/dbg_frontend/dbg_frontend_core.c @@ -11504,6 +11504,38 @@ df_frame(void) txt_scope_close(txt_scope); hs_scope_close(hs_scope); }break; + case DF_CmdKind_RunToCursor: + { + if(df_regs()->file_path.size != 0) + { + df_cmd(DF_CmdKind_RunToLine); + } + else + { + df_cmd(DF_CmdKind_RunToAddress); + } + }break; + case DF_CmdKind_SetNextStatement: + { + D_Entity *thread = d_entity_from_handle(df_regs()->thread); + String8 file_path = df_regs()->file_path; + U64 new_rip_vaddr = df_regs()->vaddr_range.min; + if(file_path.size != 0) + { + D_LineList *lines = &df_regs()->lines; + for(D_LineNode *n = lines->first; n != 0; n = n->next) + { + D_EntityList modules = d_modules_from_dbgi_key(scratch.arena, &n->v.dbgi_key); + D_Entity *module = d_module_from_thread_candidates(thread, &modules); + if(!d_entity_is_nil(module)) + { + new_rip_vaddr = d_vaddr_from_voff(module, n->v.voff_range.min); + break; + } + } + } + d_cmd(D_CmdKind_SetThreadIP, .entity = d_handle_from_entity(thread), .vaddr = new_rip_vaddr); + }break; //- rjf: targets case DF_CmdKind_AddTarget: @@ -11587,7 +11619,7 @@ df_frame(void) log_infof("\"#MARKER\""); }break; - //- rjf: OS events + //- rjf: os event passthrough case DF_CmdKind_OSEvent: { OS_Event *os_event = df_regs()->os_event; @@ -11620,6 +11652,89 @@ df_frame(void) } }break; + //- rjf: debug control context management operations + case DF_CmdKind_SelectThread: + { + D_Entity *thread = d_entity_from_handle(df_regs()->thread); + D_Entity *module = d_module_from_thread(thread); + D_Entity *process = d_entity_ancestor_from_kind(thread, D_EntityKind_Process); + df_state->base_regs.v.unwind_count = 0; + df_state->base_regs.v.inline_depth = 0; + df_state->base_regs.v.thread = d_handle_from_entity(thread); + df_state->base_regs.v.module = d_handle_from_entity(module); + df_state->base_regs.v.process = d_handle_from_entity(process); + df_cmd(DF_CmdKind_FindThread, .thread = d_handle_from_entity(thread)); + }break; + case DF_CmdKind_SelectUnwind: + { + DI_Scope *di_scope = di_scope_open(); + D_Entity *thread = d_entity_from_handle(df_base_regs()->thread); + D_Entity *process = d_entity_ancestor_from_kind(thread, D_EntityKind_Process); + CTRL_Unwind base_unwind = d_query_cached_unwind_from_thread(thread); + D_Unwind rich_unwind = d_unwind_from_ctrl_unwind(scratch.arena, di_scope, process, &base_unwind); + if(df_regs()->unwind_count < rich_unwind.frames.concrete_frame_count) + { + D_UnwindFrame *frame = &rich_unwind.frames.v[df_regs()->unwind_count]; + df_state->base_regs.v.unwind_count = df_regs()->unwind_count; + df_state->base_regs.v.inline_depth = 0; + if(df_regs()->inline_depth <= frame->inline_frame_count) + { + d_state->base_regs.v.inline_depth = df_regs()->inline_depth; + } + } + df_cmd(DF_CmdKind_FindThread, .thread = d_handle_from_entity(thread)); + di_scope_close(di_scope); + }break; + case DF_CmdKind_UpOneFrame: + case DF_CmdKind_DownOneFrame: + { + DI_Scope *di_scope = di_scope_open(); + D_Entity *thread = d_entity_from_handle(df_base_regs()->thread); + D_Entity *process = d_entity_ancestor_from_kind(thread, D_EntityKind_Process); + CTRL_Unwind base_unwind = d_query_cached_unwind_from_thread(thread); + D_Unwind rich_unwind = d_unwind_from_ctrl_unwind(scratch.arena, di_scope, process, &base_unwind); + U64 crnt_unwind_idx = d_state->base_regs.v.unwind_count; + U64 crnt_inline_dpt = d_state->base_regs.v.inline_depth; + U64 next_unwind_idx = crnt_unwind_idx; + U64 next_inline_dpt = crnt_inline_dpt; + if(crnt_unwind_idx < rich_unwind.frames.concrete_frame_count) + { + D_UnwindFrame *f = &rich_unwind.frames.v[crnt_unwind_idx]; + switch(kind) + { + default:{}break; + case DF_CmdKind_UpOneFrame: + { + if(crnt_inline_dpt < f->inline_frame_count) + { + next_inline_dpt += 1; + } + else if(crnt_unwind_idx > 0) + { + next_unwind_idx -= 1; + next_inline_dpt = 0; + } + }break; + case DF_CmdKind_DownOneFrame: + { + if(crnt_inline_dpt > 0) + { + next_inline_dpt -= 1; + } + else if(crnt_unwind_idx < rich_unwind.frames.concrete_frame_count) + { + next_unwind_idx += 1; + next_inline_dpt = (f+1)->inline_frame_count; + } + }break; + } + } + df_cmd(DF_CmdKind_SelectUnwind, + .unwind_count = next_unwind_idx, + .inline_depth = next_inline_dpt); + di_scope_close(di_scope); + }break; + //- rjf: meta controls case DF_CmdKind_Edit: { @@ -12101,7 +12216,43 @@ df_frame(void) ////////////////////////////// //- rjf: tick debug engine // - d_tick(scratch.arena, &targets, &breakpoints); + D_EventList engine_events = d_tick(scratch.arena, &targets, &breakpoints); + + ////////////////////////////// + //- rjf: process debug engine events + // + for(D_EventNode *n = engine_events.first; n != 0; n = n->next) + { + D_Event *evt = &n->v; + switch(evt->kind) + { + default:{}break; + case D_EventKind_Stop: + { + CTRL_Entity *thread = ctrl_entity_from_handle(d_state->ctrl_entity_store, evt->thread); + U64 vaddr = evt->vaddr; + + // rjf: valid stop thread? -> select & snap + if(thread != &ctrl_entity_nil) + { + // TODO(rjf) + } + + // rjf: no stop-causing thread, but have selected thread? -> snap to selected + CTRL_Entity *selected_thread = &ctrl_entity_nil; // TODO(rjf): ctrl_entity_from_handle(d_state->ctrl_entity_store, df_base_regs()->thread); + if(thread == &ctrl_entity_nil && selected_thread != &ctrl_entity_nil) + { + // TODO(rjf) + } + + // rjf: increment breakpoint hit counts + if(evt->cause == D_EventCause_UserBreakpoint) + { + + } + }break; + } + } ////////////////////////////// //- rjf: apply new rich hover info diff --git a/src/dbg_frontend/dbg_frontend_core.h b/src/dbg_frontend/dbg_frontend_core.h index 2b5d1bac..e4e3bb29 100644 --- a/src/dbg_frontend/dbg_frontend_core.h +++ b/src/dbg_frontend/dbg_frontend_core.h @@ -727,9 +727,6 @@ struct DF_State U64 view_rule_spec_table_size; DF_ViewRuleSpec **view_rule_spec_table; - // rjf: cmd param slot -> view spec rule table - DF_CmdParamSlotViewSpecRuleList cmd_param_slot_view_spec_table[D_CmdParamSlot_COUNT]; - // rjf: windows DF_Window *first_window; DF_Window *last_window; diff --git a/src/dbg_frontend/generated/dbg_frontend.meta.c b/src/dbg_frontend/generated/dbg_frontend.meta.c index edbe4bcb..0ecc61cc 100644 --- a/src/dbg_frontend/generated/dbg_frontend.meta.c +++ b/src/dbg_frontend/generated/dbg_frontend.meta.c @@ -64,7 +64,7 @@ Rng1U64 df_reg_slot_range_table[32] = {OffsetOf(DF_Regs, os_event), OffsetOf(DF_Regs, os_event) + sizeof(OS_Event *)}, }; -DF_CmdKindInfo df_cmd_kind_info_table[220] = +DF_CmdKindInfo df_cmd_kind_info_table[219] = { {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"), DF_IconKind_Play, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*1), DF_RegSlot_EntityList, str8_lit_comp(""), D_EntityKind_Target}}, @@ -87,12 +87,6 @@ DF_CmdKindInfo df_cmd_kind_info_table[220] = { 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"), DF_IconKind_Redo, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, { 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"), DF_IconKind_StepInto, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, { 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"), DF_IconKind_StepOver, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, -{ 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"), DF_IconKind_Play, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, -{ 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"), DF_IconKind_RightArrow, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, -{ str8_lit_comp("select_thread"), str8_lit_comp("Selects a thread."), str8_lit_comp(""), str8_lit_comp("Select Thread"), DF_IconKind_Null, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*1), DF_RegSlot_Entity, str8_lit_comp(""), D_EntityKind_Thread}}, -{ 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"), DF_IconKind_Null, (DF_CmdKindFlag_ListInUI*0)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, -{ 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"), DF_IconKind_UpArrow, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, -{ 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"), DF_IconKind_DownArrow, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, { str8_lit_comp("freeze_thread"), str8_lit_comp("Freezes the passed thread."), str8_lit_comp("callstack,unwind"), str8_lit_comp("Freeze Thread"), DF_IconKind_Locked, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*1), DF_RegSlot_Entity, str8_lit_comp(""), D_EntityKind_Thread}}, { str8_lit_comp("thaw_thread"), str8_lit_comp("Thaws the passed thread."), str8_lit_comp(""), str8_lit_comp("Thaw Thread"), DF_IconKind_Unlocked, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*1), DF_RegSlot_Entity, str8_lit_comp(""), D_EntityKind_Thread}}, { str8_lit_comp("freeze_process"), str8_lit_comp("Freezes the passed process."), str8_lit_comp(""), str8_lit_comp("Freeze Process"), DF_IconKind_Locked, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*1), DF_RegSlot_Entity, str8_lit_comp(""), D_EntityKind_Process}}, @@ -106,8 +100,11 @@ DF_CmdKindInfo df_cmd_kind_info_table[220] = { 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"), DF_IconKind_Null, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*1), DF_RegSlot_PID, str8_lit_comp(""), D_EntityKind_Nil}}, { str8_lit_comp("exit"), str8_lit_comp("Exits the debugger."), str8_lit_comp("quit,close,abort"), str8_lit_comp("Exit"), DF_IconKind_X, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, { 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"), DF_IconKind_Null, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*1), DF_RegSlot_String, str8_lit_comp("commands"), D_EntityKind_Nil}}, -{ str8_lit_comp("error"), str8_lit_comp("Notifies of an error."), str8_lit_comp(""), str8_lit_comp("Error"), DF_IconKind_Null, (DF_CmdKindFlag_ListInUI*0)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, { str8_lit_comp("os_event"), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp("OS Event"), DF_IconKind_Null, (DF_CmdKindFlag_ListInUI*0)|(DF_CmdKindFlag_ListInIPCDocs*0), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, +{ str8_lit_comp("select_thread"), str8_lit_comp("Selects a thread."), str8_lit_comp(""), str8_lit_comp("Select Thread"), DF_IconKind_Null, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*1), DF_RegSlot_Entity, str8_lit_comp(""), D_EntityKind_Thread}}, +{ 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"), DF_IconKind_Null, (DF_CmdKindFlag_ListInUI*0)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, +{ 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"), DF_IconKind_UpArrow, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, +{ 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"), DF_IconKind_DownArrow, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, { str8_lit_comp("inc_ui_font_scale"), str8_lit_comp("Increases the font size used for UI."), str8_lit_comp(""), str8_lit_comp("Increase UI Font Scale"), DF_IconKind_Null, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, { str8_lit_comp("dec_ui_font_scale"), str8_lit_comp("Decreases the font size used for UI."), str8_lit_comp(""), str8_lit_comp("Decrease UI Font Scale"), DF_IconKind_Null, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, { str8_lit_comp("inc_code_font_scale"), str8_lit_comp("Increases the font size used for code."), str8_lit_comp(""), str8_lit_comp("Increase Code Font Scale"), DF_IconKind_Null, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, @@ -242,6 +239,8 @@ DF_CmdKindInfo df_cmd_kind_info_table[220] = { str8_lit_comp("toggle_watch_pin"), str8_lit_comp("Places or removes a watch pin at a given location (file path and line number or address)."), str8_lit_comp(""), str8_lit_comp("Toggle Watch Pin"), DF_IconKind_Binoculars, (DF_CmdKindFlag_ListInUI*0)|(DF_CmdKindFlag_ListInIPCDocs*0), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, { str8_lit_comp("toggle_breakpoint_cursor"), str8_lit_comp("Places or removes a breakpoint on the line on which the active cursor sits."), str8_lit_comp(""), str8_lit_comp("Toggle Breakpoint At Cursor"), DF_IconKind_CircleFilled, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, { str8_lit_comp("toggle_watch_pin_at_cursor"), str8_lit_comp("Places or removes a watch pin at the cursor on the currently active file."), str8_lit_comp(""), str8_lit_comp("Toggle Watch Pin At Cursor"), DF_IconKind_Binoculars, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*1)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*1), DF_RegSlot_String, str8_lit_comp(""), D_EntityKind_Nil}}, +{ 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"), DF_IconKind_Play, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, +{ 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"), DF_IconKind_RightArrow, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*0), DF_RegSlot_Null, str8_lit_comp(""), D_EntityKind_Nil}}, { str8_lit_comp("add_target"), str8_lit_comp("Adds a new target."), str8_lit_comp("application,executable,debug"), str8_lit_comp("Add Target"), DF_IconKind_Target, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*1)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*1), DF_RegSlot_FilePath, str8_lit_comp(""), D_EntityKind_Nil}}, { str8_lit_comp("remove_target"), str8_lit_comp("Removes an existing target."), str8_lit_comp("delete,remove,target"), str8_lit_comp("Remove Target"), DF_IconKind_Trash, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*1), DF_RegSlot_Entity, str8_lit_comp(""), D_EntityKind_Target}}, { str8_lit_comp("edit_target"), str8_lit_comp("Edits an existing target."), str8_lit_comp(""), str8_lit_comp("Edit Target"), DF_IconKind_Pencil, (DF_CmdKindFlag_ListInUI*1)|(DF_CmdKindFlag_ListInIPCDocs*1), {(DF_QueryFlag_AllowFiles*0)|(DF_QueryFlag_AllowFolders*0)|(DF_QueryFlag_CodeInput*0)|(DF_QueryFlag_KeepOldInput*0)|(DF_QueryFlag_SelectOldInput*0)|(DF_QueryFlag_Required*1), DF_RegSlot_Entity, str8_lit_comp(""), D_EntityKind_Target}}, diff --git a/src/dbg_frontend/generated/dbg_frontend.meta.h b/src/dbg_frontend/generated/dbg_frontend.meta.h index a2fdd90f..9b1cfc7b 100644 --- a/src/dbg_frontend/generated/dbg_frontend.meta.h +++ b/src/dbg_frontend/generated/dbg_frontend.meta.h @@ -66,12 +66,6 @@ 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, @@ -85,8 +79,11 @@ DF_CmdKind_ThawEntity, DF_CmdKind_Attach, DF_CmdKind_Exit, DF_CmdKind_RunCommand, -DF_CmdKind_Error, DF_CmdKind_OSEvent, +DF_CmdKind_SelectThread, +DF_CmdKind_SelectUnwind, +DF_CmdKind_UpOneFrame, +DF_CmdKind_DownOneFrame, DF_CmdKind_IncUIFontScale, DF_CmdKind_DecUIFontScale, DF_CmdKind_IncCodeFontScale, @@ -221,6 +218,8 @@ DF_CmdKind_AddWatchPin, DF_CmdKind_ToggleWatchPin, DF_CmdKind_ToggleBreakpointAtCursor, DF_CmdKind_ToggleWatchPinAtCursor, +DF_CmdKind_RunToCursor, +DF_CmdKind_SetNextStatement, DF_CmdKind_AddTarget, DF_CmdKind_RemoveTarget, DF_CmdKind_EditTarget,