begin entity simplification pass; begin eliminating frontend file system entity cache; build new path-based file override systems, instead of relying on the entity tree

This commit is contained in:
Ryan Fleury
2024-08-12 17:06:59 -07:00
parent 86f45ce5e7
commit 057d4d485e
16 changed files with 658 additions and 580 deletions
+240 -80
View File
@@ -1745,13 +1745,11 @@ df_entity_equip_entity_handle(DF_Entity *entity, DF_Handle handle)
}
internal void
df_entity_equip_b32(DF_Entity *entity, B32 b32)
df_entity_equip_disabled(DF_Entity *entity, B32 value)
{
df_require_entity_nonnil(entity, return);
df_state_delta_history_push_struct_delta(df_state_delta_history(), &entity->b32, .guard_entity = entity);
df_state_delta_history_push_struct_delta(df_state_delta_history(), &entity->flags, .guard_entity = entity);
entity->b32 = b32;
entity->flags |= DF_EntityFlag_HasB32;
df_state_delta_history_push_struct_delta(df_state_delta_history(), &entity->disabled, .guard_entity = entity);
entity->disabled = value;
df_entity_notify_mutation(entity);
}
@@ -2151,6 +2149,81 @@ df_possible_overrides_from_entity(Arena *arena, DF_Entity *entity)
return result;
}
//- rjf: file path map override lookups
internal String8List
df_possible_overrides_from_file_path(Arena *arena, String8 file_path)
{
// NOTE(rjf): This path, given some target file path, scans all file path map
// overrides, and collects the set of file paths which could've redirected
// to the target file path given the set of file path maps.
//
// For example, if I have a rule saying D:/devel/ maps to C:/devel/, and I
// feed in C:/devel/foo/bar.txt, then this path will construct
// D:/devel/foo/bar.txt, as a possible option.
//
// It will also preserve C:/devel/foo/bar.txt in the resultant list, so that
// overrideless files still work through this path, and both redirected
// files and non-redirected files can go through the same path.
//
String8List result = {0};
str8_list_push(arena, &result, file_path);
Temp scratch = scratch_begin(&arena, 1);
PathStyle pth_style = PathStyle_Relative;
String8List pth_parts = path_normalized_list_from_string(scratch.arena, file_path, &pth_style);
{
DF_EntityList links = df_query_cached_entity_list_with_kind(DF_EntityKind_OverrideFileLink);
for(DF_EntityNode *n = links.first; n != 0; n = n->next)
{
//- rjf: unpack link
DF_Entity *link = n->entity;
DF_Entity *src = df_entity_child_from_kind(link, DF_EntityKind_Source);
DF_Entity *dst = df_entity_child_from_kind(link, DF_EntityKind_Dest);
PathStyle src_style = PathStyle_Relative;
PathStyle dst_style = PathStyle_Relative;
String8List src_parts = path_normalized_list_from_string(scratch.arena, src->name, &src_style);
String8List dst_parts = path_normalized_list_from_string(scratch.arena, dst->name, &dst_style);
//- rjf: determine if this link can possibly redirect to the target file path
B32 dst_redirects_to_pth = 0;
String8Node *non_redirected_pth_first = 0;
if(dst_style == pth_style && dst_parts.first != 0 && pth_parts.first != 0)
{
dst_redirects_to_pth = 1;
String8Node *dst_n = dst_parts.first;
String8Node *pth_n = pth_parts.first;
for(;dst_n != 0 && pth_n != 0; dst_n = dst_n->next, pth_n = pth_n->next)
{
if(!str8_match(dst_n->string, pth_n->string, StringMatchFlag_CaseInsensitive))
{
dst_redirects_to_pth = 0;
break;
}
non_redirected_pth_first = pth_n->next;
}
}
//- rjf: if this link can redirect to this path via `src` -> `dst`, compute
// possible full source path, by taking `src` and appending non-redirected
// suffix (which did not show up in `dst`)
if(dst_redirects_to_pth)
{
String8List candidate_parts = src_parts;
for(String8Node *p = non_redirected_pth_first; p != 0; p = p->next)
{
str8_list_push(scratch.arena, &candidate_parts, p->string);
}
StringJoin join = {0};
join.sep = str8_lit("/");
String8 candidate_path = str8_list_join(arena, &candidate_parts, 0);
str8_list_push(arena, &result, candidate_path);
}
}
}
scratch_end(scratch);
return result;
}
//- rjf: top-level state queries
internal DF_Entity *
@@ -2653,8 +2726,7 @@ df_trap_net_from_thread__step_over_line(Arena *arena, DF_Entity *thread)
{
line_voff_rng = lines.first->v.voff_range;
line_vaddr_rng = df_vaddr_range_from_voff_range(module, line_voff_rng);
DF_Entity *file = df_entity_from_handle(lines.first->v.file);
log_infof("line: {%S:%I64i}\n", file->name, lines.first->v.pt.line);
log_infof("line: {%S:%I64i}\n", lines.first->v.file_path, lines.first->v.pt.line);
}
log_infof("voff_range: {0x%I64x, 0x%I64x}\n", line_voff_rng.min, line_voff_rng.max);
log_infof("vaddr_range: {0x%I64x, 0x%I64x}\n", line_vaddr_rng.min, line_vaddr_rng.max);
@@ -3216,7 +3288,7 @@ df_lines_from_dbgi_key_voff(Arena *arena, DI_Key *dbgi_key, U64 voff)
result.count += 1;
if(line->file_idx != 0 && file_normalized_full_path.size != 0)
{
n->v.file = df_handle_from_entity(df_entity_from_path(file_normalized_full_path, DF_EntityFromPathFlag_All));
n->v.file_path = file_normalized_full_path;
}
n->v.pt = txt_pt(line->line_num, column ? column->col_first : 1);
n->v.voff_range = r1u64(parsed_line_table.voffs[line_info_idx], parsed_line_table.voffs[line_info_idx+1]);
@@ -3242,7 +3314,7 @@ df_lines_from_dbgi_key_voff(Arena *arena, DI_Key *dbgi_key, U64 voff)
//- rjf: file:line -> line info
internal DF_LineListArray
df_lines_array_from_file_line_range(Arena *arena, DF_Entity *file, Rng1S64 line_num_range)
df_lines_array_from_file_path_line_range(Arena *arena, String8 file_path, Rng1S64 line_num_range)
{
DF_LineListArray array = {0};
{
@@ -3252,13 +3324,12 @@ df_lines_array_from_file_line_range(Arena *arena, DF_Entity *file, Rng1S64 line_
Temp scratch = scratch_begin(&arena, 1);
DI_Scope *scope = di_scope_open();
DI_KeyList dbgi_keys = df_push_active_dbgi_key_list(scratch.arena);
DF_EntityList overrides = df_possible_overrides_from_entity(scratch.arena, file);
for(DF_EntityNode *override_n = overrides.first;
String8List overrides = df_possible_overrides_from_file_path(scratch.arena, file_path);
for(String8Node *override_n = overrides.first;
override_n != 0;
override_n = override_n->next)
{
DF_Entity *override = override_n->entity;
String8 file_path = df_full_path_from_entity(scratch.arena, override);
String8 file_path = override_n->string;
String8 file_path_normalized = lower_from_str8(scratch.arena, file_path);
for(DI_KeyNode *dbgi_key_n = dbgi_keys.first;
dbgi_key_n != 0;
@@ -3342,9 +3413,9 @@ df_lines_array_from_file_line_range(Arena *arena, DF_Entity *file, Rng1S64 line_
}
internal DF_LineList
df_lines_from_file_line_num(Arena *arena, DF_Entity *file, S64 line_num)
df_lines_from_file_path_line_num(Arena *arena, String8 file_path, S64 line_num)
{
DF_LineListArray array = df_lines_array_from_file_line_range(arena, file, r1s64(line_num, line_num+1));
DF_LineListArray array = df_lines_array_from_file_path_line_range(arena, file_path, r1s64(line_num, line_num+1));
DF_LineList list = {0};
if(array.count != 0)
{
@@ -3727,7 +3798,7 @@ df_ctrl_run(DF_RunKind run, DF_Entity *run_thread, CTRL_RunFlags flags, CTRL_Tra
{
// rjf: unpack user breakpoint entity
DF_Entity *user_bp = user_bp_n->entity;
if(user_bp->b32 == 0)
if(user_bp->disabled)
{
continue;
}
@@ -5315,8 +5386,90 @@ internal String8List
df_cfg_strings_from_core(Arena *arena, String8 root_path, DF_CfgSrc source)
{
ProfBeginFunction();
local_persist char *spaces = " ";
local_persist char *slashes= "////////////////////////////////////////////////////////////////////////////////";
String8List strs = {0};
//- rjf: write all entities
{
struct {DF_EntityKind kind; String8 title; } kinds_to_write[] =
{
{DF_EntityKind_RecentProject, str8_lit_comp("recent projects")},
{DF_EntityKind_Target, str8_lit_comp("targets")},
{DF_EntityKind_OverrideFileLink,str8_lit_comp("file path maps")},
{DF_EntityKind_AutoViewRule, str8_lit_comp("auto view rules")},
{DF_EntityKind_Breakpoint, str8_lit_comp("breakpoints")},
{DF_EntityKind_Watch, str8_lit_comp("watch")},
{DF_EntityKind_WatchPin, str8_lit_comp("watch_pin")},
};
for(U64 idx = 0; idx < ArrayCount(kinds_to_write); idx += 1)
{
B32 first = 1;
DF_EntityList entities = df_query_cached_entity_list_with_kind(kinds_to_write[idx].kind);
for(DF_EntityNode *n = entities.first; n != 0; n = n->next)
{
DF_Entity *entity = n->entity;
if(entity->cfg_src != source)
{
continue;
}
if(first)
{
first = 0;
str8_list_pushf(arena, &strs, "/// %S %.*s\n\n",
kinds_to_write[idx].title,
(int)Max(0, 80 - ((S64)kinds_to_write[idx].title.size + 5)),
slashes);
}
DF_EntityRec rec = {0};
S64 depth = 0;
for(DF_Entity *e = entity; !df_entity_is_nil(e); e = rec.next)
{
// rjf: write entity title
str8_list_pushf(arena, &strs, "WIP_%S:\n{\n", df_g_entity_kind_name_lower_table[e->kind]);
// rjf: write this entity's info
String8 entity_name_escaped = df_cfg_escaped_from_raw_string(arena, e->name);
if(entity_name_escaped.size != 0)
{
str8_list_pushf(arena, &strs, "name: \"%S\"\n", entity_name_escaped);
}
if(e->disabled)
{
str8_list_pushf(arena, &strs, "disabled: 1\n");
}
if(e->flags & DF_EntityFlag_HasColor)
{
Vec4F32 hsva = df_hsva_from_entity(e);
Vec4F32 rgba = rgba_from_hsva(hsva);
U32 rgba_hex = u32_from_rgba(rgba);
str8_list_pushf(arena, &strs, "color: 0x%x\n", rgba_hex);
}
// rjf: get next iteration
rec = df_entity_rec_df_pre(e, entity);
// rjf: push
if(rec.push_count == 0)
{
str8_list_pushf(arena, &strs, "}\n%s", depth == 0 ? "\n" : "");
}
depth += rec.push_count;
// rjf: pop
{
DF_Entity *e_popped = e;
for(S64 pop_idx = 0; pop_idx < rec.pop_count; e_popped = e_popped->parent, pop_idx += 1)
{
depth -= 1;
str8_list_pushf(arena, &strs, "}\n%s", depth == 0 ? "\n" : "");
}
}
}
}
}
}
//- rjf: write recent projects
{
B32 first = 1;
@@ -5389,7 +5542,7 @@ df_cfg_strings_from_core(Arena *arena, String8 root_path, DF_CfgSrc source)
{
str8_list_pushf(arena, &strs, " entry_point: \"%S\"\n", entry_escaped);
}
str8_list_pushf(arena, &strs, " active: %i\n", (int)target->b32);
str8_list_pushf(arena, &strs, " active: %i\n", (int)!target->disabled);
if(target->flags & DF_EntityFlag_HasColor)
{
Vec4F32 hsva = df_hsva_from_entity(target);
@@ -5511,7 +5664,7 @@ df_cfg_strings_from_core(Arena *arena, String8 root_path, DF_CfgSrc source)
}
// rjf: universal options
str8_list_pushf(arena, &strs, " enabled: %i\n", (int)bp->b32);
str8_list_pushf(arena, &strs, " enabled: %i\n", (int)!bp->disabled);
if(bp->name.size != 0)
{
String8 label_escaped = df_cfg_escaped_from_raw_string(arena, bp->name);
@@ -5737,7 +5890,7 @@ df_push_active_target_list(Arena *arena)
DF_EntityList all_targets = df_query_cached_entity_list_with_kind(DF_EntityKind_Target);
for(DF_EntityNode *n = all_targets.first; n != 0; n = n->next)
{
if(n->entity->b32)
if(!n->entity->disabled)
{
df_entity_list_push(arena, &active_targets, n->entity);
}
@@ -6236,6 +6389,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
df_state->dt = dt;
df_state->time_in_seconds += dt;
df_state->top_interact_regs = &df_state->base_interact_regs;
df_state->top_interact_regs->v.file_path = push_str8_copy(df_frame_arena(), df_state->top_interact_regs->v.file_path);
df_state->top_interact_regs->v.lines = df_line_list_copy(df_frame_arena(), &df_state->top_interact_regs->v.lines);
df_state->top_interact_regs->v.dbgi_key = di_key_copy(df_frame_arena(), &df_state->top_interact_regs->v.dbgi_key);
@@ -6324,16 +6478,11 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
for(DF_EntityNode *n = user_bps.first; n != 0; n = n->next)
{
DF_Entity *bp = n->entity;
DF_Entity *symb = df_entity_child_from_kind(bp, DF_EntityKind_EntryPointName);
if(bp->flags & DF_EntityFlag_HasVAddr && bp->vaddr == stop_thread_vaddr)
DF_Entity *loc = df_entity_child_from_kind(bp, DF_EntityKind_Location);
DF_LineList loc_lines = df_lines_from_file_path_line_num(scratch.arena, loc->name, loc->text_point.line);
if(loc_lines.first != 0)
{
bp->u64 += 1;
}
if(bp->flags & DF_EntityFlag_HasTextPoint)
{
DF_Entity *bp_file = df_entity_ancestor_from_kind(bp, DF_EntityKind_File);
DF_LineList lines = df_lines_from_file_line_num(scratch.arena, bp_file, bp->text_point.line);
for(DF_LineNode *n = lines.first; n != 0; n = n->next)
for(DF_LineNode *n = loc_lines.first; n != 0; n = n->next)
{
if(contains_1u64(n->v.voff_range, stop_thread_voff))
{
@@ -6342,9 +6491,13 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
}
}
}
if(!df_entity_is_nil(symb))
else if(loc->flags & DF_EntityFlag_HasVAddr && stop_thread_vaddr == loc->vaddr)
{
U64 symb_voff = df_voff_from_dbgi_key_symbol_name(&dbgi_key, symb->name);
bp->u64 += 1;
}
else if(loc->name.size != 0)
{
U64 symb_voff = df_voff_from_dbgi_key_symbol_name(&dbgi_key, loc->name);
if(symb_voff == stop_thread_voff)
{
bp->u64 += 1;
@@ -7037,7 +7190,6 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
{
DF_Entity *bp = df_entity_alloc(file, DF_EntityKind_Breakpoint);
bp->flags |= DF_EntityFlag_DiesOnRunStop;
df_entity_equip_b32(bp, 1);
df_entity_equip_txt_pt(bp, point);
df_entity_equip_cfg_src(bp, DF_CfgSrc_Transient);
DF_CmdParams p = df_cmd_params_zero();
@@ -7048,7 +7200,6 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
{
DF_Entity *bp = df_entity_alloc(df_entity_root(), DF_EntityKind_Breakpoint);
bp->flags |= DF_EntityFlag_DiesOnRunStop;
df_entity_equip_b32(bp, 1);
df_entity_equip_vaddr(bp, params.vaddr);
df_entity_equip_cfg_src(bp, DF_CfgSrc_Transient);
DF_CmdParams p = df_cmd_params_zero();
@@ -7556,7 +7707,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
for(DF_EntityNode *n = existing_target_entities.first; n != 0; n = n->next)
{
DF_Entity *target = n->entity;
if(target->cfg_src == DF_CfgSrc_CommandLine && target->b32)
if(target->cfg_src == DF_CfgSrc_CommandLine && !target->disabled)
{
cmd_line_target_present = 1;
}
@@ -7598,7 +7749,10 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
String8 saved_label_raw = df_cfg_raw_from_escaped_string(scratch.arena, saved_label);
String8 saved_entry_raw = df_cfg_raw_from_escaped_string(scratch.arena, saved_entry_point);
String8 saved_args_raw = df_cfg_raw_from_escaped_string(scratch.arena, args_cfg->first->string);
df_entity_equip_b32(target__ent, active_cfg != &df_g_nil_cfg_node ? !!is_active_u64 : 1);
if(!is_active_u64)
{
df_entity_equip_disabled(target__ent, 1);
}
df_entity_equip_name(target__ent, saved_label_raw);
df_entity_equip_name(exe__ent, saved_exe_absolute);
df_entity_equip_name(args__ent, saved_args_raw);
@@ -7726,7 +7880,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
// rjf: build entity
{
DF_Entity *bp_ent = df_entity_alloc(bp_parent_ent, DF_EntityKind_Breakpoint);
df_entity_equip_b32(bp_ent, is_enabled);
df_entity_equip_disabled(bp_ent, !is_enabled);
df_entity_equip_cfg_src(bp_ent, src);
if(pt.line != 0)
{
@@ -7907,8 +8061,9 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
String8 header = push_str8f(scratch.arena, "// raddbg %s file\n\n", df_g_cfg_src_string_table[src].str);
str8_list_push_front(scratch.arena, &strs, header);
String8 data = str8_list_join(scratch.arena, &strs, 0);
String8 data_indented = indented_from_string(scratch.arena, data);
df_state->cfg_write_issued[src] = 1;
df_cfg_push_write_string(src, data);
df_cfg_push_write_string(src, data_indented);
}break;
//- rjf: override file links
@@ -7975,6 +8130,11 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
// D:/1/2/3.c
// -> override C:/foo/bar/baz.c -> D:/1/2/3.c
//- rjf: unpack
String8 src_path = params.string;
String8 dst_path = params.file_path;
// TODO(rjf):
//- rjf: grab src file & chosen replacement
DF_Entity *file = df_entity_from_handle(params.entity);
DF_Entity *replacement = df_entity_from_path(params.file_path, DF_EntityFromPathFlag_OpenAsNeeded|DF_EntityFromPathFlag_OpenMissing);
@@ -8074,7 +8234,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
DF_Entity *entity = df_entity_from_handle(params.entity);
DF_StateDeltaHistoryBatch(df_state_delta_history())
{
df_entity_equip_b32(entity, 1);
df_entity_equip_disabled(entity, 0);
}
}break;
case DF_CoreCmdKind_DisableEntity:
@@ -8084,7 +8244,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
DF_Entity *entity = df_entity_from_handle(params.entity);
DF_StateDeltaHistoryBatch(df_state_delta_history())
{
df_entity_equip_b32(entity, 0);
df_entity_equip_disabled(entity, 1);
}
}break;
case DF_CoreCmdKind_FreezeEntity:
@@ -8146,11 +8306,11 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
df_state_delta_history_batch_end(df_state_delta_history());
}
if(src_n->flags & DF_EntityFlag_HasTextPoint) {df_entity_equip_txt_pt(dst_n, src_n->text_point);}
if(src_n->flags & DF_EntityFlag_HasB32) {df_entity_equip_b32(dst_n, src_n->b32);}
if(src_n->flags & DF_EntityFlag_HasU64) {df_entity_equip_u64(dst_n, src_n->u64);}
if(src_n->flags & DF_EntityFlag_HasColor) {df_entity_equip_color_hsva(dst_n, df_hsva_from_entity(src_n));}
if(src_n->flags & DF_EntityFlag_HasVAddrRng) {df_entity_equip_vaddr_rng(dst_n, src_n->vaddr_rng);}
if(src_n->flags & DF_EntityFlag_HasVAddr) {df_entity_equip_vaddr(dst_n, src_n->vaddr);}
if(src_n->disabled) {df_entity_equip_disabled(dst_n, 1);}
if(src_n->name.size != 0) {df_entity_equip_name(dst_n, src_n->name);}
dst_n->cfg_src = src_n->cfg_src;
for(DF_Entity *src_child = task->src_n->first; !df_entity_is_nil(src_child); src_child = src_child->next)
@@ -8165,6 +8325,28 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
}break;
//- rjf: breakpoints
case DF_CoreCmdKind_AddBreakpoint:
{
String8 file_path = params.file_path;
TxtPt pt = params.text_point;
String8 name = params.string;
U64 vaddr = params.vaddr;
DF_Entity *bp = df_entity_alloc(df_entity_root(), DF_EntityKind_Breakpoint);
DF_Entity *loc = df_entity_alloc(bp, DF_EntityKind_Location);
if(file_path.size != 0 && pt.line != 0)
{
df_entity_equip_name(loc, file_path);
df_entity_equip_txt_pt(loc, pt);
}
else if(name.size != 0)
{
df_entity_equip_name(loc, name);
}
else if(vaddr != 0)
{
df_entity_equip_vaddr(loc, vaddr);
}
}break;
case DF_CoreCmdKind_TextBreakpoint:
{
DF_Entity *entity = df_entity_from_handle(params.entity);
@@ -8194,7 +8376,6 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
bp = df_entity_alloc(entity, DF_EntityKind_Breakpoint);
}
df_entity_equip_txt_pt(bp, params.text_point);
df_entity_equip_b32(bp, 1);
df_entity_equip_cfg_src(bp, DF_CfgSrc_Project);
}
}
@@ -8221,7 +8402,6 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
bp = df_entity_alloc(df_entity_root(), DF_EntityKind_Breakpoint);
}
df_entity_equip_vaddr(bp, vaddr);
df_entity_equip_b32(bp, 1);
df_entity_equip_cfg_src(bp, DF_CfgSrc_Project);
}
else
@@ -8245,7 +8425,6 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
}
DF_Entity *symbol_name_entity = df_entity_alloc(bp, DF_EntityKind_EntryPointName);
df_entity_equip_name(symbol_name_entity, function_name);
df_entity_equip_b32(bp, 1);
df_entity_equip_cfg_src(bp, DF_CfgSrc_Project);
}
else
@@ -8317,40 +8496,21 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
case DF_CoreCmdKind_ToggleBreakpointAtCursor:
{
DF_InteractRegs *regs = df_interact_regs();
DF_Entity *file = df_entity_from_handle(regs->file);
if(file->kind == DF_EntityKind_File && regs->cursor.line != 0)
{
DF_CmdParams p = df_cmd_params_zero();
p.entity = df_handle_from_entity(file);
p.text_point = regs->cursor;
df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_TextBreakpoint));
}
else if(regs->vaddr_range.min != 0)
{
DF_CmdParams p = df_cmd_params_zero();
p.vaddr = regs->vaddr_range.min;
df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_AddressBreakpoint));
}
DF_CmdParams p = df_cmd_params_zero();
p.file_path = regs->file_path;
p.text_point = regs->cursor;
p.vaddr = regs->vaddr_range.min;
df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleBreakpoint));
}break;
case DF_CoreCmdKind_ToggleWatchPinAtCursor:
{
DF_InteractRegs *regs = df_interact_regs();
DF_Entity *file = df_entity_from_handle(regs->file);
if(file->kind == DF_EntityKind_File && regs->cursor.line != 0)
{
DF_CmdParams p = df_cmd_params_zero();
p.entity = df_handle_from_entity(file);
p.text_point = regs->cursor;
p.string = params.string;
df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchPin));
}
else if(regs->vaddr_range.min != 0)
{
DF_CmdParams p = df_cmd_params_zero();
p.vaddr = regs->vaddr_range.min;
p.string = params.string;
df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchPin));
}
DF_CmdParams p = df_cmd_params_zero();
p.file_path = regs->file_path;
p.text_point = regs->cursor;
p.vaddr = regs->vaddr_range.min;
p.string = params.string;
df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchPin));
}break;
case DF_CoreCmdKind_GoToNameAtCursor:
case DF_CoreCmdKind_ToggleWatchExpressionAtCursor:
@@ -8384,11 +8544,11 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
}break;
case DF_CoreCmdKind_RunToCursor:
{
DF_Entity *file = df_entity_from_handle(df_interact_regs()->file);
if(!df_entity_is_nil(file))
String8 file_path = df_interact_regs()->file_path;
if(file_path.size != 0)
{
DF_CmdParams p = df_cmd_params_zero();
p.entity = df_handle_from_entity(file);
p.file_path = file_path;
p.text_point = df_interact_regs()->cursor;
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunToLine));
}
@@ -8401,10 +8561,10 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
}break;
case DF_CoreCmdKind_SetNextStatement:
{
DF_Entity *file = df_entity_from_handle(df_interact_regs()->file);
DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread);
String8 file_path = df_interact_regs()->file_path;
U64 new_rip_vaddr = df_interact_regs()->vaddr_range.min;
if(!df_entity_is_nil(file))
if(file_path.size != 0)
{
DF_LineList *lines = &df_interact_regs()->lines;
for(DF_LineNode *n = lines->first; n != 0; n = n->next)
@@ -8457,15 +8617,15 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
DF_StateDeltaHistoryBatch(df_state_delta_history())
{
DF_EntityList all_targets = df_query_cached_entity_list_with_kind(DF_EntityKind_Target);
B32 is_selected = entity->b32;
B32 is_selected = !entity->disabled;
for(DF_EntityNode *n = all_targets.first; n != 0; n = n->next)
{
DF_Entity *target = n->entity;
df_entity_equip_b32(target, 0);
df_entity_equip_disabled(target, 1);
}
if(!is_selected)
{
df_entity_equip_b32(entity, 1);
df_entity_equip_disabled(entity, 0);
}
}
}
+9 -7
View File
@@ -293,7 +293,6 @@ enum
//- rjf: allocationless, simple equipment
DF_EntityFlag_HasTextPoint = (1<<0),
DF_EntityFlag_HasEntityHandle = (1<<2),
DF_EntityFlag_HasB32 = (1<<3),
DF_EntityFlag_HasU64 = (1<<4),
DF_EntityFlag_HasColor = (1<<6),
DF_EntityFlag_DiesOnRunStop = (1<<8),
@@ -340,7 +339,7 @@ struct DF_Entity
// rjf: basic equipment
TxtPt text_point;
DF_Handle entity_handle;
B32 b32;
B32 disabled;
U64 u64;
Vec4F32 color_hsva;
F32 life_left;
@@ -450,7 +449,7 @@ struct DF_Unwind
typedef struct DF_Line DF_Line;
struct DF_Line
{
DF_Handle file;
String8 file_path;
TxtPt pt;
Rng1U64 voff_range;
DI_Key dbgi_key;
@@ -555,7 +554,7 @@ struct DF_InteractRegs
DF_Handle window;
DF_Handle panel;
DF_Handle view;
DF_Handle file;
String8 file_path;
TxtPt cursor;
TxtPt mark;
U128 text_key;
@@ -1441,7 +1440,7 @@ internal void df_entity_change_parent(DF_Entity *entity, DF_Entity *old_parent,
//- rjf: entity simple equipment
internal void df_entity_equip_txt_pt(DF_Entity *entity, TxtPt point);
internal void df_entity_equip_entity_handle(DF_Entity *entity, DF_Handle handle);
internal void df_entity_equip_b32(DF_Entity *entity, B32 b32);
internal void df_entity_equip_disabled(DF_Entity *entity, B32 b32);
internal void df_entity_equip_u64(DF_Entity *entity, U64 u64);
internal void df_entity_equip_color_rgba(DF_Entity *entity, Vec4F32 rgba);
internal void df_entity_equip_color_hsva(DF_Entity *entity, Vec4F32 hsva);
@@ -1465,6 +1464,9 @@ internal void df_entity_equip_namef(DF_Entity *entity, char *fmt, ...);
internal DF_Entity *df_entity_from_path(String8 path, DF_EntityFromPathFlags flags);
internal DF_EntityList df_possible_overrides_from_entity(Arena *arena, DF_Entity *entity);
//- rjf: file path map override lookups
internal String8List df_possible_overrides_from_file_path(Arena *arena, String8 file_path);
//- rjf: top-level state queries
internal DF_Entity *df_entity_root(void);
internal DF_EntityList df_push_entity_list_with_kind(Arena *arena, DF_EntityKind kind);
@@ -1530,8 +1532,8 @@ internal U64 df_type_num_from_dbgi_key_name(DI_Key *dbgi_key, String8 name);
internal DF_LineList df_lines_from_dbgi_key_voff(Arena *arena, DI_Key *dbgi_key, U64 voff);
//- rjf: file:line -> line info
internal DF_LineListArray df_lines_array_from_file_line_range(Arena *arena, DF_Entity *file, Rng1S64 line_num_range);
internal DF_LineList df_lines_from_file_line_num(Arena *arena, DF_Entity *file, S64 line_num);
internal DF_LineListArray df_lines_array_from_file_path_line_range(Arena *arena, String8 file_path, Rng1S64 line_num_range);
internal DF_LineList df_lines_from_file_path_line_num(Arena *arena, String8 file_path, S64 line_num);
//- rjf: src -> voff lookups
internal DF_TextLineSrc2DasmInfoListArray df_text_line_src2dasm_info_list_array_from_src_line_range(Arena *arena, DF_Entity *file, Rng1S64 line_num_range);
+14 -1
View File
@@ -41,6 +41,9 @@ DF_EntityKindTable:
{Breakpoint breakpoint 1 0 0 1 1 1 1 0 0 1 0 1 0 0 0 0 1 "Label" CircleFilled "Breakpoint" }
{Condition condition 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 "Expression" CircleFilled "Condition" }
//- rjf: user-controlled locations (source, addresses, symbol names)
{Location location 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 "Location" Null "Location" }
//- rjf: targets
{Target target 1 0 1 1 1 0 1 0 0 1 0 0 0 0 0 0 1 "Label" Target "Target" }
{Executable executable 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 "Executable" Null "Executable" }
@@ -335,8 +338,13 @@ DF_CoreCmdTable:// | | | |
{NameEntity 0 0 Null Nil 0 0 0 0 0 0 Null "name_entity" "Name Entity" "Equips an entity with a name." "" }
{EditEntity 0 0 Null Nil 0 0 0 0 0 0 Null "edit_entity" "Edit Entity" "Opens the editor for an entity." "" }
{DuplicateEntity 0 0 Null Nil 0 0 0 0 0 0 Null "duplicate_entity" "Duplicate Entity" "Duplicates an entity." "" }
{RelocateEntity 0 0 Null Nil 0 0 0 0 0 0 Null "relocate_entity" "Relocate Entity" "Relocates an entity." "" }
//- rjf: breakpoints
{AddBreakpoint 0 0 Null Nil 0 0 0 0 0 0 CircleFilled "add_breakpoint" "Add Breakpoint" "Places a breakpoint at a given location (file path and line number, address, or symbol name)." "" }
{ToggleBreakpoint 0 0 Null Nil 0 0 0 0 0 0 CircleFilled "toggle_breakpoint" "Toggle Breakpoint" "Places or removes a breakpoint at a given location (file path and line number, address, or symbol name)." "" }
//- rjf: [OLD] breakpoints
{TextBreakpoint 0 1 FilePath Nil 0 0 0 0 0 0 CircleFilled "text_breakpoint" "Text Breakpoint" "Places or removes a breakpoint on the specified line of source code." "" }
{AddressBreakpoint 1 1 VirtualAddr Nil 0 0 0 0 1 1 CircleFilled "address_breakpoint" "Address Breakpoint" "Places or removes a breakpoint on the specified address." "" }
{FunctionBreakpoint 1 1 String Nil 0 0 0 0 1 1 CircleFilled "function_breakpoint" "Function Breakpoint" "Places or removes a breakpoint on the first address(es) of the specified function." "" }
@@ -384,7 +392,7 @@ DF_CoreCmdTable:// | | | |
{Scheduler 1 1 Null Nil 0 0 0 0 0 0 Scheduler "scheduler" "Scheduler" "Opens the scheduler view, for process and thread controls." "threads,processes,targets" }
{CallStack 1 1 Null Nil 0 0 0 0 0 0 Thread "call_stack" "Call Stack" "Opens the call stack view." "callstack,thread,unwind" }
{Modules 1 1 Null Nil 0 0 0 0 0 0 Module "modules" "Modules" "Opens the modules view." "" }
{PendingEntity 0 0 Null Nil 0 0 0 0 0 0 FileOutline "pending_entity" "Pending Entity" "Opens a view which waits for the passed entity to be completely loaded, then replaces itself with a new view." "" }
{PendingFile 0 0 Null Nil 0 0 0 0 0 0 FileOutline "pending_file" "Pending File" "Opens a view which asynchronously analyzes the file path parameter, then picks an appropriate viewer for it." "" }
{Code 0 0 Null Nil 0 0 0 0 0 0 FileOutline "code" "Code" "Opens the code view for an already-loaded file." "" }
{Watch 1 1 Null Nil 0 0 0 0 0 0 Binoculars "watch" "Watch" "Opens a watch view." "" }
{Locals 1 1 Null Nil 0 0 0 0 0 0 Binoculars "locals" "Locals" "Opens a locals view." "" }
@@ -691,6 +699,11 @@ DF_DevToggleTable:
@expand(DF_EntityKindTable a) `str8_lit_comp("$(a.display_string)")`,
}
@data(String8) df_g_entity_kind_name_lower_table:
{
@expand(DF_EntityKindTable a) `str8_lit_comp("$(a.name_lower)")`,
}
@data(String8) df_g_entity_kind_name_label_table:
{
@expand(DF_EntityKindTable a) `str8_lit_comp("$(a.name_label)")`,
+47 -7
View File
@@ -32,7 +32,7 @@ Rng1U64 df_g_cmd_param_slot_range_table[24] =
{OffsetOf(DF_CmdParams, inline_depth), OffsetOf(DF_CmdParams, inline_depth) + sizeof(U64)},
};
DF_IconKind df_g_entity_kind_icon_kind_table[27] =
DF_IconKind df_g_entity_kind_icon_kind_table[28] =
{
DF_IconKind_Null,
DF_IconKind_Null,
@@ -45,6 +45,7 @@ DF_IconKind_Binoculars,
DF_IconKind_Binoculars,
DF_IconKind_CircleFilled,
DF_IconKind_CircleFilled,
DF_IconKind_Null,
DF_IconKind_Target,
DF_IconKind_Null,
DF_IconKind_Null,
@@ -63,7 +64,7 @@ DF_IconKind_Null,
DF_IconKind_Null,
};
String8 df_g_entity_kind_display_string_table[27] =
String8 df_g_entity_kind_display_string_table[28] =
{
str8_lit_comp("Nil"),
str8_lit_comp("Root"),
@@ -76,6 +77,7 @@ str8_lit_comp("Watch"),
str8_lit_comp("View Rule"),
str8_lit_comp("Breakpoint"),
str8_lit_comp("Condition"),
str8_lit_comp("Location"),
str8_lit_comp("Target"),
str8_lit_comp("Executable"),
str8_lit_comp("Arguments"),
@@ -94,7 +96,39 @@ str8_lit_comp("Conversion Failure"),
str8_lit_comp("EndedProcess"),
};
String8 df_g_entity_kind_name_label_table[27] =
String8 df_g_entity_kind_name_lower_table[28] =
{
str8_lit_comp("nil"),
str8_lit_comp("root"),
str8_lit_comp("machine"),
str8_lit_comp("file"),
str8_lit_comp("override_file_link"),
str8_lit_comp("auto_view_rule"),
str8_lit_comp("watch_pin"),
str8_lit_comp("watch"),
str8_lit_comp("view_rule"),
str8_lit_comp("breakpoint"),
str8_lit_comp("condition"),
str8_lit_comp("location"),
str8_lit_comp("target"),
str8_lit_comp("executable"),
str8_lit_comp("arguments"),
str8_lit_comp("execution_path"),
str8_lit_comp("entry_point_name"),
str8_lit_comp("recent_project"),
str8_lit_comp("source"),
str8_lit_comp("dest"),
str8_lit_comp("process"),
str8_lit_comp("thread"),
str8_lit_comp("module"),
str8_lit_comp("pending_thread_name"),
str8_lit_comp("debug_info_path"),
str8_lit_comp("conversion_task"),
str8_lit_comp("conversion_fail"),
str8_lit_comp("ended_process"),
};
String8 df_g_entity_kind_name_label_table[28] =
{
str8_lit_comp("Label"),
str8_lit_comp("Label"),
@@ -107,6 +141,7 @@ str8_lit_comp("Expression"),
str8_lit_comp("Expression"),
str8_lit_comp("Label"),
str8_lit_comp("Expression"),
str8_lit_comp("Location"),
str8_lit_comp("Label"),
str8_lit_comp("Executable"),
str8_lit_comp("Arguments"),
@@ -125,7 +160,7 @@ str8_lit_comp("Label"),
str8_lit_comp("Label"),
};
DF_EntityKindFlags df_g_entity_kind_flags_table[27] =
DF_EntityKindFlags df_g_entity_kind_flags_table[28] =
{
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
@@ -138,6 +173,7 @@ DF_EntityKindFlags df_g_entity_kind_flags_table[27] =
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 1*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 1*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 1*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 1*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 1*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 1*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 1*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 1*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
@@ -156,7 +192,7 @@ DF_EntityKindFlags df_g_entity_kind_flags_table[27] =
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
};
DF_EntityOpFlags df_g_entity_kind_op_flags_table[27] =
DF_EntityOpFlags df_g_entity_kind_op_flags_table[28] =
{
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
@@ -169,6 +205,7 @@ DF_EntityOpFlags df_g_entity_kind_op_flags_table[27] =
(1*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (1*DF_EntityOpFlag_Rename) | (1*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (1*DF_EntityOpFlag_Duplicate),
(1*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (1*DF_EntityOpFlag_Rename) | (1*DF_EntityOpFlag_Enable) | (1*DF_EntityOpFlag_Condition) | (1*DF_EntityOpFlag_Duplicate),
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
(1*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (1*DF_EntityOpFlag_Edit) | (1*DF_EntityOpFlag_Rename) | (1*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (1*DF_EntityOpFlag_Duplicate),
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
@@ -219,7 +256,7 @@ DF_CoreCmdKind_Null,
DF_CoreCmdKind_Null,
};
DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[219] =
DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[222] =
{
{ str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), (DF_CmdSpecFlag_ListInUI*0)|(DF_CmdSpecFlag_ListInIPCDocs*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("exit"), str8_lit_comp("Exits the debugger."), str8_lit_comp("quit,close,abort"), str8_lit_comp("Exit"), (DF_CmdSpecFlag_ListInUI*1)|(DF_CmdSpecFlag_ListInIPCDocs*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_X},
@@ -384,6 +421,9 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[219] =
{ str8_lit_comp("name_entity"), str8_lit_comp("Equips an entity with a name."), str8_lit_comp(""), str8_lit_comp("Name Entity"), (DF_CmdSpecFlag_ListInUI*0)|(DF_CmdSpecFlag_ListInIPCDocs*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("edit_entity"), str8_lit_comp("Opens the editor for an entity."), str8_lit_comp(""), str8_lit_comp("Edit Entity"), (DF_CmdSpecFlag_ListInUI*0)|(DF_CmdSpecFlag_ListInIPCDocs*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("duplicate_entity"), str8_lit_comp("Duplicates an entity."), str8_lit_comp(""), str8_lit_comp("Duplicate Entity"), (DF_CmdSpecFlag_ListInUI*0)|(DF_CmdSpecFlag_ListInIPCDocs*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("relocate_entity"), str8_lit_comp("Relocates an entity."), str8_lit_comp(""), str8_lit_comp("Relocate Entity"), (DF_CmdSpecFlag_ListInUI*0)|(DF_CmdSpecFlag_ListInIPCDocs*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("add_breakpoint"), str8_lit_comp("Places a breakpoint at a given location (file path and line number, address, or symbol name)."), str8_lit_comp(""), str8_lit_comp("Add Breakpoint"), (DF_CmdSpecFlag_ListInUI*0)|(DF_CmdSpecFlag_ListInIPCDocs*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_CircleFilled},
{ str8_lit_comp("toggle_breakpoint"), str8_lit_comp("Places or removes a breakpoint at a given location (file path and line number, address, or symbol name)."), str8_lit_comp(""), str8_lit_comp("Toggle Breakpoint"), (DF_CmdSpecFlag_ListInUI*0)|(DF_CmdSpecFlag_ListInIPCDocs*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_CircleFilled},
{ str8_lit_comp("text_breakpoint"), str8_lit_comp("Places or removes a breakpoint on the specified line of source code."), str8_lit_comp(""), str8_lit_comp("Text Breakpoint"), (DF_CmdSpecFlag_ListInUI*0)|(DF_CmdSpecFlag_ListInIPCDocs*1), {DF_CmdParamSlot_FilePath, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_CircleFilled},
{ str8_lit_comp("address_breakpoint"), str8_lit_comp("Places or removes a breakpoint on the specified address."), str8_lit_comp(""), str8_lit_comp("Address Breakpoint"), (DF_CmdSpecFlag_ListInUI*1)|(DF_CmdSpecFlag_ListInIPCDocs*1), {DF_CmdParamSlot_VirtualAddr, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*1)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_CircleFilled},
{ str8_lit_comp("function_breakpoint"), str8_lit_comp("Places or removes a breakpoint on the first address(es) of the specified function."), str8_lit_comp(""), str8_lit_comp("Function Breakpoint"), (DF_CmdSpecFlag_ListInUI*1)|(DF_CmdSpecFlag_ListInIPCDocs*1), {DF_CmdParamSlot_String, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*1)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_CircleFilled},
@@ -417,7 +457,7 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[219] =
{ str8_lit_comp("scheduler"), str8_lit_comp("Opens the scheduler view, for process and thread controls."), str8_lit_comp("threads,processes,targets"), str8_lit_comp("Scheduler"), (DF_CmdSpecFlag_ListInUI*1)|(DF_CmdSpecFlag_ListInIPCDocs*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Scheduler},
{ str8_lit_comp("call_stack"), str8_lit_comp("Opens the call stack view."), str8_lit_comp("callstack,thread,unwind"), str8_lit_comp("Call Stack"), (DF_CmdSpecFlag_ListInUI*1)|(DF_CmdSpecFlag_ListInIPCDocs*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Thread},
{ str8_lit_comp("modules"), str8_lit_comp("Opens the modules view."), str8_lit_comp(""), str8_lit_comp("Modules"), (DF_CmdSpecFlag_ListInUI*1)|(DF_CmdSpecFlag_ListInIPCDocs*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Module},
{ str8_lit_comp("pending_entity"), str8_lit_comp("Opens a view which waits for the passed entity to be completely loaded, then replaces itself with a new view."), str8_lit_comp(""), str8_lit_comp("Pending Entity"), (DF_CmdSpecFlag_ListInUI*0)|(DF_CmdSpecFlag_ListInIPCDocs*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_FileOutline},
{ str8_lit_comp("pending_file"), str8_lit_comp("Opens a view which asynchronously analyzes the file path parameter, then picks an appropriate viewer for it."), str8_lit_comp(""), str8_lit_comp("Pending File"), (DF_CmdSpecFlag_ListInUI*0)|(DF_CmdSpecFlag_ListInIPCDocs*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_FileOutline},
{ str8_lit_comp("code"), str8_lit_comp("Opens the code view for an already-loaded file."), str8_lit_comp(""), str8_lit_comp("Code"), (DF_CmdSpecFlag_ListInUI*0)|(DF_CmdSpecFlag_ListInIPCDocs*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_FileOutline},
{ str8_lit_comp("watch"), str8_lit_comp("Opens a watch view."), str8_lit_comp(""), str8_lit_comp("Watch"), (DF_CmdSpecFlag_ListInUI*1)|(DF_CmdSpecFlag_ListInIPCDocs*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Binoculars},
{ str8_lit_comp("locals"), str8_lit_comp("Opens a locals view."), str8_lit_comp(""), str8_lit_comp("Locals"), (DF_CmdSpecFlag_ListInUI*1)|(DF_CmdSpecFlag_ListInIPCDocs*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Binoculars},
+11 -6
View File
@@ -28,6 +28,7 @@ DF_EntityKind_Watch,
DF_EntityKind_ViewRule,
DF_EntityKind_Breakpoint,
DF_EntityKind_Condition,
DF_EntityKind_Location,
DF_EntityKind_Target,
DF_EntityKind_Executable,
DF_EntityKind_Arguments,
@@ -212,6 +213,9 @@ DF_CoreCmdKind_RemoveEntity,
DF_CoreCmdKind_NameEntity,
DF_CoreCmdKind_EditEntity,
DF_CoreCmdKind_DuplicateEntity,
DF_CoreCmdKind_RelocateEntity,
DF_CoreCmdKind_AddBreakpoint,
DF_CoreCmdKind_ToggleBreakpoint,
DF_CoreCmdKind_TextBreakpoint,
DF_CoreCmdKind_AddressBreakpoint,
DF_CoreCmdKind_FunctionBreakpoint,
@@ -245,7 +249,7 @@ DF_CoreCmdKind_AutoViewRules,
DF_CoreCmdKind_Scheduler,
DF_CoreCmdKind_CallStack,
DF_CoreCmdKind_Modules,
DF_CoreCmdKind_PendingEntity,
DF_CoreCmdKind_PendingFile,
DF_CoreCmdKind_Code,
DF_CoreCmdKind_Watch,
DF_CoreCmdKind_Locals,
@@ -463,11 +467,12 @@ struct {B32 *value_ptr; String8 name;} DEV_toggle_table[] =
};
C_LINKAGE_BEGIN
extern Rng1U64 df_g_cmd_param_slot_range_table[24];
extern DF_IconKind df_g_entity_kind_icon_kind_table[27];
extern String8 df_g_entity_kind_display_string_table[27];
extern String8 df_g_entity_kind_name_label_table[27];
extern DF_EntityKindFlags df_g_entity_kind_flags_table[27];
extern DF_EntityOpFlags df_g_entity_kind_op_flags_table[27];
extern DF_IconKind df_g_entity_kind_icon_kind_table[28];
extern String8 df_g_entity_kind_display_string_table[28];
extern String8 df_g_entity_kind_name_lower_table[28];
extern String8 df_g_entity_kind_name_label_table[28];
extern DF_EntityKindFlags df_g_entity_kind_flags_table[28];
extern DF_EntityOpFlags df_g_entity_kind_op_flags_table[28];
extern String8 df_g_cfg_src_string_table[4];
extern DF_CoreCmdKind df_g_cfg_src_load_cmd_kind_table[4];
extern DF_CoreCmdKind df_g_cfg_src_write_cmd_kind_table[4];