mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-18 01:52:22 -07:00
split engine from frontend cmd structure; use to begin fixing/hardening engine commands and decoupling them from frontend complications
This commit is contained in:
@@ -390,10 +390,10 @@ d_cmd_params_apply_spec_query(Arena *arena, D_CmdParams *params, D_CmdSpec *spec
|
||||
//- rjf: command lists
|
||||
|
||||
internal void
|
||||
d_cmd_list_push(Arena *arena, D_CmdList *cmds, D_CmdParams *params, D_CmdSpec *spec)
|
||||
d_cmd_list_push_new(Arena *arena, D_CmdList *cmds, D_CmdKind kind, D_CmdParams *params)
|
||||
{
|
||||
D_CmdNode *n = push_array(arena, D_CmdNode, 1);
|
||||
n->cmd.spec = spec;
|
||||
n->cmd.kind = kind;
|
||||
n->cmd.params = df_cmd_params_copy(arena, params);
|
||||
DLLPushBack(cmds->first, cmds->last, n);
|
||||
cmds->count += 1;
|
||||
@@ -3823,9 +3823,9 @@ d_query_cached_member_map_from_dbgi_key_voff(DI_Key *dbgi_key, U64 voff)
|
||||
//- rjf: top-level command dispatch
|
||||
|
||||
internal void
|
||||
d_push_cmd(D_CmdSpec *spec, D_CmdParams *params)
|
||||
d_push_cmd(D_CmdKind kind, D_CmdParams *params)
|
||||
{
|
||||
d_cmd_list_push(d_state->cmds_arena, &d_state->cmds, params, spec);
|
||||
d_cmd_list_push_new(d_state->cmds_arena, &d_state->cmds, kind, params);
|
||||
}
|
||||
|
||||
//- rjf: command iteration
|
||||
@@ -3998,9 +3998,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints)
|
||||
if(should_snap && stop_thread->kind == D_EntityKind_Thread)
|
||||
{
|
||||
log_infof("stop_thread: \"%S\"\n", d_display_string_from_entity(scratch.arena, stop_thread));
|
||||
D_CmdParams params = d_cmd_params_zero();
|
||||
params.entity = d_handle_from_entity(stop_thread);
|
||||
d_push_cmd(d_cmd_spec_from_kind(D_CmdKind_SelectThread), ¶ms);
|
||||
d_cmd(D_CmdKind_SelectThread, .entity = d_handle_from_entity(stop_thread));
|
||||
}
|
||||
|
||||
// rjf: if no stop-causing thread, and if selected thread, snap to selected
|
||||
@@ -4181,9 +4179,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints)
|
||||
B32 do_initial_snap = (already_existing_processes.count == 1 && thread_idx_in_process == 0);
|
||||
if(do_initial_snap)
|
||||
{
|
||||
D_CmdParams params = d_cmd_params_zero();
|
||||
params.entity = d_handle_from_entity(entity);
|
||||
d_push_cmd(d_cmd_spec_from_kind(D_CmdKind_SelectThread), ¶ms);
|
||||
d_cmd(D_CmdKind_SelectThread, .entity = d_handle_from_entity(entity));
|
||||
}
|
||||
}break;
|
||||
|
||||
@@ -4489,8 +4485,6 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints)
|
||||
{
|
||||
// rjf: unpack command
|
||||
D_CmdParams params = cmd->params;
|
||||
D_CmdKind core_cmd_kind = d_cmd_kind_from_string(cmd->spec->info.string);
|
||||
d_cmd_spec_counter_inc(cmd->spec);
|
||||
|
||||
// rjf: prep ctrl running arguments
|
||||
B32 need_run = 0;
|
||||
@@ -4500,7 +4494,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints)
|
||||
CTRL_TrapList run_traps = {0};
|
||||
|
||||
// rjf: process command
|
||||
switch(core_cmd_kind)
|
||||
switch(cmd->kind)
|
||||
{
|
||||
default:{}break;
|
||||
|
||||
@@ -4581,7 +4575,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints)
|
||||
need_run = 1;
|
||||
run_kind = D_RunKind_Run;
|
||||
run_thread = &ctrl_entity_nil;
|
||||
run_flags = (core_cmd_kind == D_CmdKind_LaunchAndInit) ? CTRL_RunFlag_StopOnEntryPoint : 0;
|
||||
run_flags = (cmd->kind == D_CmdKind_LaunchAndInit) ? CTRL_RunFlag_StopOnEntryPoint : 0;
|
||||
}
|
||||
|
||||
// rjf: no targets -> error
|
||||
@@ -4700,7 +4694,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints)
|
||||
{
|
||||
B32 good = 1;
|
||||
CTRL_TrapList traps = {0};
|
||||
switch(core_cmd_kind)
|
||||
switch(cmd->kind)
|
||||
{
|
||||
default: break;
|
||||
case D_CmdKind_StepIntoInst: {}break;
|
||||
@@ -4804,8 +4798,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints)
|
||||
D_Entity *loc = d_entity_alloc(bp, D_EntityKind_Location);
|
||||
d_entity_equip_name(loc, file_path);
|
||||
d_entity_equip_txt_pt(loc, point);
|
||||
D_CmdParams p = d_cmd_params_zero();
|
||||
d_push_cmd(d_cmd_spec_from_kind(D_CmdKind_Run), &p);
|
||||
d_cmd(D_CmdKind_Run);
|
||||
}break;
|
||||
case D_CmdKind_RunToAddress:
|
||||
{
|
||||
@@ -4814,8 +4807,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints)
|
||||
bp->flags |= D_EntityFlag_DiesOnRunStop;
|
||||
D_Entity *loc = d_entity_alloc(bp, D_EntityKind_Location);
|
||||
d_entity_equip_vaddr(loc, params.vaddr);
|
||||
D_CmdParams p = d_cmd_params_zero();
|
||||
d_push_cmd(d_cmd_spec_from_kind(D_CmdKind_Run), &p);
|
||||
d_cmd(D_CmdKind_Run);
|
||||
}break;
|
||||
case D_CmdKind_Run:
|
||||
{
|
||||
@@ -4823,21 +4815,17 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints)
|
||||
D_EntityList processes = d_query_cached_entity_list_with_kind(D_EntityKind_Process);
|
||||
if(processes.count != 0)
|
||||
{
|
||||
D_CmdParams params = d_cmd_params_zero();
|
||||
d_push_cmd(d_cmd_spec_from_kind(D_CmdKind_Continue), ¶ms);
|
||||
d_cmd(D_CmdKind_Continue);
|
||||
}
|
||||
else if(!d_ctrl_targets_running())
|
||||
{
|
||||
d_push_cmd(d_cmd_spec_from_kind(D_CmdKind_LaunchAndRun), ¶ms);
|
||||
d_cmd(D_CmdKind_LaunchAndRun);
|
||||
}
|
||||
}break;
|
||||
case D_CmdKind_Restart:
|
||||
{
|
||||
// rjf: kill all
|
||||
{
|
||||
D_CmdParams params = d_cmd_params_zero();
|
||||
d_push_cmd(d_cmd_spec_from_kind(D_CmdKind_KillAll), ¶ms);
|
||||
}
|
||||
d_cmd(D_CmdKind_KillAll);
|
||||
|
||||
// rjf: gather targets corresponding to all launched processes
|
||||
D_EntityList targets = {0};
|
||||
@@ -4855,11 +4843,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints)
|
||||
}
|
||||
|
||||
// rjf: re-launch targets
|
||||
{
|
||||
D_CmdParams params = d_cmd_params_zero();
|
||||
params.entity_list = d_handle_list_from_entity_list(scratch.arena, targets);
|
||||
d_push_cmd(d_cmd_spec_from_kind(D_CmdKind_LaunchAndRun), ¶ms);
|
||||
}
|
||||
d_cmd(D_CmdKind_LaunchAndRun, .entity_list = d_handle_list_from_entity_list(scratch.arena, targets));
|
||||
}break;
|
||||
case D_CmdKind_StepInto:
|
||||
case D_CmdKind_StepOver:
|
||||
@@ -4867,24 +4851,22 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints)
|
||||
D_EntityList processes = d_query_cached_entity_list_with_kind(D_EntityKind_Process);
|
||||
if(processes.count != 0)
|
||||
{
|
||||
D_CmdKind step_cmd_kind = (core_cmd_kind == D_CmdKind_StepInto
|
||||
D_CmdKind step_cmd_kind = (cmd->kind == D_CmdKind_StepInto
|
||||
? D_CmdKind_StepIntoLine
|
||||
: D_CmdKind_StepOverLine);
|
||||
B32 prefer_dasm = params.prefer_dasm;
|
||||
if(prefer_dasm)
|
||||
{
|
||||
step_cmd_kind = (core_cmd_kind == D_CmdKind_StepInto
|
||||
step_cmd_kind = (cmd->kind == D_CmdKind_StepInto
|
||||
? D_CmdKind_StepIntoInst
|
||||
: D_CmdKind_StepOverInst);
|
||||
}
|
||||
d_push_cmd(d_cmd_spec_from_kind(step_cmd_kind), ¶ms);
|
||||
d_cmd(step_cmd_kind);
|
||||
}
|
||||
else if(!d_ctrl_targets_running())
|
||||
{
|
||||
D_EntityList targets = d_push_active_target_list(scratch.arena);
|
||||
D_CmdParams p = params;
|
||||
p.entity_list = d_handle_list_from_entity_list(scratch.arena, targets);
|
||||
d_push_cmd(d_cmd_spec_from_kind(D_CmdKind_LaunchAndInit), &p);
|
||||
d_cmd(D_CmdKind_LaunchAndInit, .entity_list = d_handle_list_from_entity_list(scratch.arena, targets));
|
||||
}
|
||||
}break;
|
||||
case D_CmdKind_RunToCursor:
|
||||
@@ -4918,10 +4900,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints)
|
||||
}
|
||||
}
|
||||
}
|
||||
D_CmdParams p = d_cmd_params_zero();
|
||||
p.entity = d_handle_from_entity(thread);
|
||||
p.vaddr = new_rip_vaddr;
|
||||
d_push_cmd(d_cmd_spec_from_kind(D_CmdKind_SetThreadIP), &p);
|
||||
d_cmd(D_CmdKind_SetThreadIP, .entity = d_handle_from_entity(thread), .vaddr = new_rip_vaddr);
|
||||
}break;
|
||||
|
||||
|
||||
@@ -4973,7 +4952,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints)
|
||||
if(crnt_unwind_idx < rich_unwind.frames.concrete_frame_count)
|
||||
{
|
||||
D_UnwindFrame *f = &rich_unwind.frames.v[crnt_unwind_idx];
|
||||
switch(core_cmd_kind)
|
||||
switch(cmd->kind)
|
||||
{
|
||||
default:{}break;
|
||||
case D_CmdKind_UpOneFrame:
|
||||
@@ -5002,10 +4981,9 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints)
|
||||
}break;
|
||||
}
|
||||
}
|
||||
D_CmdParams p = params;
|
||||
p.unwind_index = next_unwind_idx;
|
||||
p.inline_depth = next_inline_dpt;
|
||||
d_push_cmd(d_cmd_spec_from_kind(D_CmdKind_SelectUnwind), &p);
|
||||
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:
|
||||
@@ -5015,31 +4993,27 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints)
|
||||
case D_CmdKind_FreezeMachine:
|
||||
case D_CmdKind_ThawMachine:
|
||||
{
|
||||
D_CmdKind disptch_kind = ((core_cmd_kind == D_CmdKind_FreezeThread ||
|
||||
core_cmd_kind == D_CmdKind_FreezeProcess ||
|
||||
core_cmd_kind == D_CmdKind_FreezeMachine)
|
||||
D_CmdKind disptch_kind = ((cmd->kind == D_CmdKind_FreezeThread ||
|
||||
cmd->kind == D_CmdKind_FreezeProcess ||
|
||||
cmd->kind == D_CmdKind_FreezeMachine)
|
||||
? D_CmdKind_FreezeEntity
|
||||
: D_CmdKind_ThawEntity);
|
||||
d_push_cmd(d_cmd_spec_from_kind(disptch_kind), ¶ms);
|
||||
d_push_cmd(disptch_kind, ¶ms);
|
||||
}break;
|
||||
case D_CmdKind_FreezeLocalMachine:
|
||||
{
|
||||
CTRL_MachineID machine_id = CTRL_MachineID_Local;
|
||||
D_CmdParams params = d_cmd_params_zero();
|
||||
params.entity = d_handle_from_entity(d_machine_entity_from_machine_id(machine_id));
|
||||
d_push_cmd(d_cmd_spec_from_kind(D_CmdKind_FreezeMachine), ¶ms);
|
||||
d_cmd(D_CmdKind_FreezeMachine, .entity = d_handle_from_entity(d_machine_entity_from_machine_id(machine_id)));
|
||||
}break;
|
||||
case D_CmdKind_ThawLocalMachine:
|
||||
{
|
||||
CTRL_MachineID machine_id = CTRL_MachineID_Local;
|
||||
D_CmdParams params = d_cmd_params_zero();
|
||||
params.entity = d_handle_from_entity(d_machine_entity_from_machine_id(machine_id));
|
||||
d_push_cmd(d_cmd_spec_from_kind(D_CmdKind_ThawMachine), ¶ms);
|
||||
d_cmd(D_CmdKind_ThawMachine, .entity = d_handle_from_entity(d_machine_entity_from_machine_id(machine_id)));
|
||||
}break;
|
||||
case D_CmdKind_FreezeEntity:
|
||||
case D_CmdKind_ThawEntity:
|
||||
{
|
||||
B32 should_freeze = (core_cmd_kind == D_CmdKind_FreezeEntity);
|
||||
B32 should_freeze = (cmd->kind == D_CmdKind_FreezeEntity);
|
||||
D_Entity *root = d_entity_from_handle(params.entity);
|
||||
for(D_Entity *e = root; !d_entity_is_nil(e); e = d_entity_rec_depth_first_pre(e, root).next)
|
||||
{
|
||||
|
||||
@@ -497,8 +497,8 @@ struct D_CmdSpecInfoArray
|
||||
typedef struct D_Cmd D_Cmd;
|
||||
struct D_Cmd
|
||||
{
|
||||
D_CmdKind kind;
|
||||
D_CmdParams params;
|
||||
D_CmdSpec *spec;
|
||||
};
|
||||
|
||||
typedef struct D_CmdNode D_CmdNode;
|
||||
@@ -776,7 +776,7 @@ internal D_CmdParams d_cmd_params_zero(void);
|
||||
internal String8 d_cmd_params_apply_spec_query(Arena *arena, D_CmdParams *params, D_CmdSpec *spec, String8 query);
|
||||
|
||||
//- rjf: command lists
|
||||
internal void d_cmd_list_push(Arena *arena, D_CmdList *cmds, D_CmdParams *params, D_CmdSpec *spec);
|
||||
internal void d_cmd_list_push_new(Arena *arena, D_CmdList *cmds, D_CmdKind kind, D_CmdParams *params);
|
||||
|
||||
//- rjf: string -> core layer command kind
|
||||
internal D_CmdKind d_cmd_kind_from_string(String8 string);
|
||||
@@ -1040,8 +1040,8 @@ internal E_String2NumMap *d_query_cached_locals_map_from_dbgi_key_voff(DI_Key *d
|
||||
internal E_String2NumMap *d_query_cached_member_map_from_dbgi_key_voff(DI_Key *dbgi_key, U64 voff);
|
||||
|
||||
//- rjf: top-level command dispatch
|
||||
internal void d_push_cmd(D_CmdSpec *spec, D_CmdParams *params);
|
||||
#define d_cmd(kind, ...) d_push_cmd(d_cmd_spec_from_kind(kind), \
|
||||
internal void d_push_cmd(D_CmdKind kind, D_CmdParams *params);
|
||||
#define d_cmd(kind, ...) d_push_cmd((kind), \
|
||||
&(D_CmdParams) \
|
||||
{ \
|
||||
.window = d_regs()->window, \
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "generated/dbg_frontend.meta.c"
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Registers Type Pure Functions
|
||||
//~ rjf: Registers Type Functions
|
||||
|
||||
internal void
|
||||
df_regs_copy_contents(Arena *arena, DF_Regs *dst, DF_Regs *src)
|
||||
@@ -36,6 +36,19 @@ df_regs_copy(Arena *arena, DF_Regs *src)
|
||||
return dst;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Commands Type Functions
|
||||
|
||||
internal void
|
||||
df_cmd_list_push_new(Arena *arena, DF_CmdList *cmds, D_CmdSpec *spec, D_CmdParams *params)
|
||||
{
|
||||
DF_CmdNode *n = push_array(arena, DF_CmdNode, 1);
|
||||
n->cmd.spec = spec;
|
||||
n->cmd.params = df_cmd_params_copy(arena, params);
|
||||
DLLPushBack(cmds->first, cmds->last, n);
|
||||
cmds->count += 1;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: View Type Functions
|
||||
|
||||
@@ -7518,18 +7531,18 @@ df_cmd_kind_from_string(String8 string)
|
||||
internal void
|
||||
df_push_cmd(D_CmdSpec *spec, D_CmdParams *params)
|
||||
{
|
||||
d_cmd_list_push(df_state->cmds_arena, &df_state->cmds, params, spec);
|
||||
df_cmd_list_push_new(df_state->cmds_arena, &df_state->cmds, spec, params);
|
||||
}
|
||||
|
||||
//- rjf: iterating
|
||||
|
||||
internal B32
|
||||
df_next_cmd(D_Cmd **cmd)
|
||||
df_next_cmd(DF_Cmd **cmd)
|
||||
{
|
||||
D_CmdNode *start_node = df_state->cmds.first;
|
||||
DF_CmdNode *start_node = df_state->cmds.first;
|
||||
if(cmd[0] != 0)
|
||||
{
|
||||
start_node = CastFromMember(D_CmdNode, cmd, cmd[0]);
|
||||
start_node = CastFromMember(DF_CmdNode, cmd, cmd[0]);
|
||||
start_node = start_node->next;
|
||||
}
|
||||
cmd[0] = 0;
|
||||
@@ -8191,7 +8204,7 @@ df_frame(void)
|
||||
//
|
||||
B32 panel_reset_done = 0;
|
||||
{
|
||||
for(D_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
for(DF_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
{
|
||||
// rjf: unpack command
|
||||
D_CmdParams *params = &cmd->params;
|
||||
@@ -8216,7 +8229,7 @@ df_frame(void)
|
||||
// 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);
|
||||
d_push_cmd((D_CmdKind)kind, params);
|
||||
}
|
||||
|
||||
// rjf: try to open tabs for "view driver" commands
|
||||
@@ -8278,7 +8291,7 @@ df_frame(void)
|
||||
processes.count == 1 ? "" : "es");
|
||||
D_CmdParams p = *params;
|
||||
p.force_confirm = 1;
|
||||
d_cmd_list_push(df_state->confirm_arena, &df_state->confirm_cmds, &p, df_cmd_spec_from_kind(DF_CmdKind_Exit));
|
||||
df_cmd_list_push_new(df_state->confirm_arena, &df_state->confirm_cmds, df_cmd_spec_from_kind(DF_CmdKind_Exit), &p);
|
||||
}
|
||||
|
||||
// rjf: otherwise, actually exit
|
||||
@@ -8366,7 +8379,7 @@ df_frame(void)
|
||||
{
|
||||
df_state->confirm_active = 0;
|
||||
df_state->confirm_key = ui_key_zero();
|
||||
for(D_CmdNode *n = df_state->confirm_cmds.first; n != 0; n = n->next)
|
||||
for(DF_CmdNode *n = df_state->confirm_cmds.first; n != 0; n = n->next)
|
||||
{
|
||||
df_push_cmd(n->cmd.spec, &n->cmd.params);
|
||||
}
|
||||
|
||||
@@ -404,6 +404,32 @@ struct DF_MsgKindInfo
|
||||
|
||||
#include "generated/dbg_frontend.meta.h"
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Command Types
|
||||
|
||||
typedef struct DF_Cmd DF_Cmd;
|
||||
struct DF_Cmd
|
||||
{
|
||||
D_CmdSpec *spec;
|
||||
D_CmdParams params;
|
||||
};
|
||||
|
||||
typedef struct DF_CmdNode DF_CmdNode;
|
||||
struct DF_CmdNode
|
||||
{
|
||||
DF_CmdNode *next;
|
||||
DF_CmdNode *prev;
|
||||
DF_Cmd cmd;
|
||||
};
|
||||
|
||||
typedef struct DF_CmdList DF_CmdList;
|
||||
struct DF_CmdList
|
||||
{
|
||||
DF_CmdNode *first;
|
||||
DF_CmdNode *last;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Context Register Types
|
||||
|
||||
@@ -670,7 +696,7 @@ struct DF_State
|
||||
|
||||
// rjf: commands
|
||||
Arena *cmds_arena;
|
||||
D_CmdList cmds;
|
||||
DF_CmdList cmds;
|
||||
|
||||
// rjf: frame request state
|
||||
U64 num_frames_requested;
|
||||
@@ -700,7 +726,7 @@ struct DF_State
|
||||
B32 confirm_active;
|
||||
F32 confirm_t;
|
||||
Arena *confirm_arena;
|
||||
D_CmdList confirm_cmds;
|
||||
DF_CmdList confirm_cmds;
|
||||
String8 confirm_title;
|
||||
String8 confirm_desc;
|
||||
|
||||
@@ -823,11 +849,16 @@ global D_Handle df_last_drag_drop_panel = {0};
|
||||
global D_Handle df_last_drag_drop_prev_tab = {0};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Registers Type Pure Functions
|
||||
//~ rjf: Registers Type Functions
|
||||
|
||||
internal void df_regs_copy_contents(Arena *arena, DF_Regs *dst, DF_Regs *src);
|
||||
internal DF_Regs *df_regs_copy(Arena *arena, DF_Regs *src);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Commands Type Functions
|
||||
|
||||
internal void df_cmd_list_push_new(Arena *arena, DF_CmdList *cmds, D_CmdSpec *spec, D_CmdParams *params);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: View Type Functions
|
||||
|
||||
@@ -1071,7 +1102,7 @@ __VA_ARGS__ \
|
||||
})
|
||||
|
||||
//- rjf: iterating
|
||||
internal B32 df_next_cmd(D_Cmd **cmd);
|
||||
internal B32 df_next_cmd(DF_Cmd **cmd);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Main Layer Top-Level Calls
|
||||
|
||||
@@ -21,7 +21,7 @@ df_code_view_init(DF_CodeViewState *cv, DF_View *view)
|
||||
internal void
|
||||
df_code_view_cmds(DF_View *view, DF_CodeViewState *cv, String8 text_data, TXT_TextInfo *text_info, DASM_LineArray *dasm_lines, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key)
|
||||
{
|
||||
for(D_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
for(DF_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
{
|
||||
// rjf: mismatched window/panel => skip
|
||||
if(!d_handle_match(d_regs()->window, cmd->params.window) ||
|
||||
@@ -4670,7 +4670,7 @@ DF_VIEW_CMD_FUNCTION_DEF(target)
|
||||
D_Entity *entity = d_entity_from_eval_string(string);
|
||||
|
||||
// rjf: process commands
|
||||
for(D_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
for(DF_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
{
|
||||
// rjf: mismatched window/panel => skip
|
||||
if(!d_handle_match(d_regs()->window, cmd->params.window) ||
|
||||
@@ -5155,7 +5155,7 @@ DF_VIEW_CMD_FUNCTION_DEF(file_path_map)
|
||||
DF_FilePathMapViewState *fpms = df_view_user_state(view, DF_FilePathMapViewState);
|
||||
|
||||
// rjf: process commands
|
||||
for(D_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
for(DF_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
{
|
||||
// rjf: mismatched window/panel => skip
|
||||
if(!d_handle_match(d_regs()->window, cmd->params.window) ||
|
||||
@@ -5788,7 +5788,7 @@ DF_VIEW_SETUP_FUNCTION_DEF(modules)
|
||||
DF_VIEW_CMD_FUNCTION_DEF(modules)
|
||||
{
|
||||
DF_ModulesViewState *mv = df_view_user_state(view, DF_ModulesViewState);
|
||||
for(D_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
for(DF_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
{
|
||||
// rjf: mismatched window/panel => skip
|
||||
if(!d_handle_match(d_regs()->window, cmd->params.window) ||
|
||||
@@ -6240,7 +6240,7 @@ typedef struct DF_PendingFileViewState DF_PendingFileViewState;
|
||||
struct DF_PendingFileViewState
|
||||
{
|
||||
Arena *deferred_cmd_arena;
|
||||
D_CmdList deferred_cmds;
|
||||
DF_CmdList deferred_cmds;
|
||||
};
|
||||
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(pending_file)
|
||||
@@ -6255,7 +6255,7 @@ DF_VIEW_CMD_FUNCTION_DEF(pending_file)
|
||||
DF_PendingFileViewState *pves = df_view_user_state(view, DF_PendingFileViewState);
|
||||
|
||||
//- rjf: process commands
|
||||
for(D_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
for(DF_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
{
|
||||
// rjf: mismatched window/panel => skip
|
||||
if(!d_handle_match(d_regs()->window, cmd->params.window) ||
|
||||
@@ -6276,7 +6276,7 @@ DF_VIEW_CMD_FUNCTION_DEF(pending_file)
|
||||
case DF_CmdKind_CenterCursor:
|
||||
case DF_CmdKind_ContainCursor:
|
||||
{
|
||||
d_cmd_list_push(pves->deferred_cmd_arena, &pves->deferred_cmds, &cmd->params, cmd->spec);
|
||||
df_cmd_list_push_new(pves->deferred_cmd_arena, &pves->deferred_cmds, cmd->spec, &cmd->params);
|
||||
}break;
|
||||
}
|
||||
}
|
||||
@@ -6326,9 +6326,9 @@ DF_VIEW_CMD_FUNCTION_DEF(pending_file)
|
||||
//- rjf: if entity is ready, dispatch all deferred commands
|
||||
if(file_is_ready)
|
||||
{
|
||||
for(D_CmdNode *cmd_node = pves->deferred_cmds.first; cmd_node != 0; cmd_node = cmd_node->next)
|
||||
for(DF_CmdNode *cmd_node = pves->deferred_cmds.first; cmd_node != 0; cmd_node = cmd_node->next)
|
||||
{
|
||||
D_Cmd *cmd = &cmd_node->cmd;
|
||||
DF_Cmd *cmd = &cmd_node->cmd;
|
||||
df_push_cmd(cmd->spec, &cmd->params);
|
||||
}
|
||||
arena_clear(pves->deferred_cmd_arena);
|
||||
@@ -6398,7 +6398,7 @@ DF_VIEW_CMD_FUNCTION_DEF(text)
|
||||
df_code_view_cmds(view, cv, data, &info, 0, r1u64(0, 0), di_key_zero());
|
||||
|
||||
//- rjf: process code-file commands
|
||||
for(D_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
for(DF_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
{
|
||||
// rjf: mismatched window/panel => skip
|
||||
if(!d_handle_match(d_regs()->window, cmd->params.window) ||
|
||||
@@ -6717,7 +6717,7 @@ DF_VIEW_CMD_FUNCTION_DEF(disasm)
|
||||
//////////////////////////////
|
||||
//- rjf: process disassembly-specific commands
|
||||
//
|
||||
for(D_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
for(DF_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
{
|
||||
D_CmdParams params = cmd->params;
|
||||
|
||||
@@ -7022,7 +7022,7 @@ DF_VIEW_SETUP_FUNCTION_DEF(memory)
|
||||
DF_VIEW_CMD_FUNCTION_DEF(memory)
|
||||
{
|
||||
DF_MemoryViewState *mv = df_view_user_state(view, DF_MemoryViewState);
|
||||
for(D_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
for(DF_Cmd *cmd = 0; df_next_cmd(&cmd);)
|
||||
{
|
||||
DF_CmdKind kind = df_cmd_kind_from_string(cmd->spec->info.string);
|
||||
D_CmdParams *params = &cmd->params;
|
||||
|
||||
Reference in New Issue
Block a user