From 057d4d485ea77e0818107238a36f3673f92cb3a0 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Mon, 12 Aug 2024 17:06:59 -0700 Subject: [PATCH] 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 --- src/base/base_strings.c | 4 + src/df/core/df_core.c | 320 +++++++++++++++----- src/df/core/df_core.h | 16 +- src/df/core/df_core.mdesk | 15 +- src/df/core/generated/df_core.meta.c | 54 +++- src/df/core/generated/df_core.meta.h | 17 +- src/df/gfx/df_gfx.c | 437 ++++++++++----------------- src/df/gfx/df_gfx.h | 57 ++-- src/df/gfx/df_gfx.mdesk | 68 ++--- src/df/gfx/df_views.c | 148 +++++---- src/df/gfx/df_views.h | 7 +- src/df/gfx/generated/df_gfx.meta.c | 70 ++--- src/df/gfx/generated/df_gfx.meta.h | 10 +- src/path/path.c | 13 + src/path/path.h | 1 + src/raddbg/raddbg_main.c | 1 - 16 files changed, 658 insertions(+), 580 deletions(-) diff --git a/src/base/base_strings.c b/src/base/base_strings.c index 91a47562..5bf3776e 100644 --- a/src/base/base_strings.c +++ b/src/base/base_strings.c @@ -1593,6 +1593,10 @@ indented_from_string(Arena *arena, String8 string) { str8_list_pushf(scratch.arena, &indented_strings, "%.*s%S\n", (int)depth*2, indentation_bytes, line); } + if(line.size == 0 && indented_strings.node_count != 0) + { + str8_list_pushf(scratch.arena, &indented_strings, "\n"); + } line_begin_off = off+1; depth = next_depth; }break; diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index e4ba27b1..e5df4e70 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -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); } } } diff --git a/src/df/core/df_core.h b/src/df/core/df_core.h index 36352b64..8c1ebaf9 100644 --- a/src/df/core/df_core.h +++ b/src/df/core/df_core.h @@ -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); diff --git a/src/df/core/df_core.mdesk b/src/df/core/df_core.mdesk index acb99d3d..1c7259b7 100644 --- a/src/df/core/df_core.mdesk +++ b/src/df/core/df_core.mdesk @@ -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)")`, diff --git a/src/df/core/generated/df_core.meta.c b/src/df/core/generated/df_core.meta.c index 4ad8398e..307f31f3 100644 --- a/src/df/core/generated/df_core.meta.c +++ b/src/df/core/generated/df_core.meta.c @@ -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}, diff --git a/src/df/core/generated/df_core.meta.h b/src/df/core/generated/df_core.meta.h index dc27b9c5..3e0f35f0 100644 --- a/src/df/core/generated/df_core.meta.h +++ b/src/df/core/generated/df_core.meta.h @@ -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]; diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 97af2d72..5496ac37 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -78,14 +78,11 @@ internal B32 df_view_is_project_filtered(DF_View *view) { B32 result = 0; - DF_Entity *view_project = df_entity_from_handle(view->project); - if(!df_entity_is_nil(view_project)) + String8 view_project = view->project_path; + if(view_project.size != 0) { - DF_Entity *current_project = df_entity_from_path(df_cfg_path_from_src(DF_CfgSrc_Project), 0); - if(current_project != view_project) - { - result = 1; - } + String8 current_project = df_cfg_path_from_src(DF_CfgSrc_Project); + result = !path_match_normalized(view_project, current_project); } return result; } @@ -366,33 +363,17 @@ internal String8 df_display_string_from_view(Arena *arena, DF_View *view) { String8 result = {0}; - switch(view->spec->info.name_kind) + if(view->params_file_path.size != 0) { - default: - case DF_NameKind_Null: - { - result = view->spec->info.display_string; - }break; - case DF_NameKind_EntityName: - { - Temp scratch = scratch_begin(&arena, 1); - DF_Entity *entity = df_entity_from_handle(view->entity); - String8 display_string = df_display_string_from_entity(scratch.arena, entity); - if(display_string.size != 0) - { - result = push_str8_copy(arena, display_string); - } - else if(df_entity_is_nil(entity)) - { - result = str8_lit("Invalid"); - } - else - { - String8 kind_string = df_g_entity_kind_display_string_table[entity->kind]; - result = push_str8f(arena, "Untitled %S", kind_string); - } - scratch_end(scratch); - }break; + result = str8_skip_last_slash(view->params_file_path); + } + else if(!df_entity_is_nil(df_entity_from_handle(view->params_entity))) + { + result = df_display_string_from_entity(arena, df_entity_from_handle(view->params_entity)); + } + else + { + result = view->spec->info.display_string; } return result; } @@ -787,7 +768,11 @@ df_view_alloc(void) // rjf: initialize view->arena = arena_alloc(); view->spec = &df_g_nil_view_spec; - view->entity = df_handle_zero(); + view->params_arena = arena_alloc(); + view->params_entity = df_handle_zero(); + view->params_file_path = str8_zero(); + view->project_path_arena = arena_alloc(); + view->project_path = str8_zero(); view->query_cursor = view->query_mark = txt_pt(1, 1); view->query_string_size = 0; df_gfx_state->allocated_view_count += 1; @@ -803,15 +788,16 @@ df_view_release(DF_View *view) arena_release(ext->arena); } view->first_arena_ext = view->last_arena_ext = 0; + arena_release(view->project_path_arena); + arena_release(view->params_arena); arena_release(view->arena); view->generation += 1; - df_gfx_state->allocated_view_count -= 1; df_gfx_state->free_view_count += 1; } internal void -df_view_equip_spec(DF_Window *window, DF_View *view, DF_ViewSpec *spec, DF_Entity *entity, String8 default_query, DF_CfgNode *cfg_root) +df_view_equip_spec(DF_Window *window, DF_View *view, DF_ViewSpec *spec, DF_Entity *entity, String8 file_path, String8 default_query, DF_CfgNode *cfg_root) { // rjf: fill arguments buffer view->query_string_size = Min(sizeof(view->query_buffer), default_query.size); @@ -825,14 +811,17 @@ df_view_equip_spec(DF_Window *window, DF_View *view, DF_ViewSpec *spec, DF_Entit df_view_clear_user_state(view); MemoryZeroStruct(&view->scroll_pos); view->spec = spec; - view->entity = df_handle_from_entity(entity); + arena_clear(view->params_arena); + view->params_file_path = push_str8_copy(view->params_arena, file_path); + view->params_entity = df_handle_from_entity(entity); if(spec->info.flags & DF_ViewSpecFlag_ProjectSpecific) { - view->project = df_handle_from_entity(df_entity_from_path(df_cfg_path_from_src(DF_CfgSrc_Project), DF_EntityFromPathFlag_OpenMissing|DF_EntityFromPathFlag_OpenAsNeeded)); + arena_clear(view->project_path_arena); + view->project_path = push_str8_copy(view->project_path_arena, df_cfg_path_from_src(DF_CfgSrc_Project)); } else { - MemoryZeroStruct(&view->project); + MemoryZeroStruct(&view->project_path); } view->is_filtering = 0; view->is_filtering_t = 0; @@ -1128,8 +1117,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) !df_view_is_nil(view); view = view->next) { - DF_Entity *entity = df_entity_from_handle(view->entity); - if(entity->flags & DF_EntityFlag_MarkedForDeletion || (df_entity_is_nil(entity) && !df_handle_match(df_handle_zero(), view->entity))) + DF_Entity *entity = df_entity_from_handle(view->params_entity); + if(entity->flags & DF_EntityFlag_MarkedForDeletion || (df_entity_is_nil(entity) && !df_handle_match(df_handle_zero(), view->params_entity))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); df_cmd_list_push(arena, cmds, ¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_CloseTab)); @@ -1484,87 +1473,87 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(df_view_is_nil(watch)) { watch = df_view_alloc(); - df_view_equip_spec(ws, watch, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Watch), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, watch, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Watch), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(layout == Layout_Default && df_view_is_nil(locals)) { locals = df_view_alloc(); - df_view_equip_spec(ws, locals, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Locals), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, locals, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Locals), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(layout == Layout_Default && df_view_is_nil(regs)) { regs = df_view_alloc(); - df_view_equip_spec(ws, regs, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Registers), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, regs, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Registers), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(layout == Layout_Default && df_view_is_nil(globals)) { globals = df_view_alloc(); - df_view_equip_spec(ws, globals, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Globals), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, globals, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Globals), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(layout == Layout_Default && df_view_is_nil(tlocals)) { tlocals = df_view_alloc(); - df_view_equip_spec(ws, tlocals, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_ThreadLocals), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, tlocals, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_ThreadLocals), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(df_view_is_nil(types)) { types = df_view_alloc(); - df_view_equip_spec(ws, types, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Types), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, types, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Types), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(layout == Layout_Default && df_view_is_nil(procs)) { procs = df_view_alloc(); - df_view_equip_spec(ws, procs, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Procedures), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, procs, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Procedures), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(df_view_is_nil(callstack)) { callstack = df_view_alloc(); - df_view_equip_spec(ws, callstack, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_CallStack), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, callstack, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_CallStack), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(df_view_is_nil(breakpoints)) { breakpoints = df_view_alloc(); - df_view_equip_spec(ws, breakpoints, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Breakpoints), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, breakpoints, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Breakpoints), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(layout == Layout_Default && df_view_is_nil(watch_pins)) { watch_pins = df_view_alloc(); - df_view_equip_spec(ws, watch_pins, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_WatchPins), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, watch_pins, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_WatchPins), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(df_view_is_nil(output)) { output = df_view_alloc(); - df_view_equip_spec(ws, output, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Output), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, output, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Output), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(df_view_is_nil(targets)) { targets = df_view_alloc(); - df_view_equip_spec(ws, targets, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Targets), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, targets, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Targets), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(df_view_is_nil(scheduler)) { scheduler = df_view_alloc(); - df_view_equip_spec(ws, scheduler, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Scheduler), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, scheduler, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Scheduler), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(df_view_is_nil(modules)) { modules = df_view_alloc(); - df_view_equip_spec(ws, modules, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Modules), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, modules, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Modules), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(df_view_is_nil(disasm)) { disasm = df_view_alloc(); - df_view_equip_spec(ws, disasm, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Disassembly), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, disasm, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Disassembly), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(layout == Layout_Default && df_view_is_nil(memory)) { memory = df_view_alloc(); - df_view_equip_spec(ws, memory, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Memory), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, memory, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Memory), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } if(code_views.count == 0 && df_view_is_nil(getting_started)) { getting_started = df_view_alloc(); - df_view_equip_spec(ws, getting_started, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_GettingStarted), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, getting_started, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_GettingStarted), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); } //- rjf: apply layout @@ -2017,7 +2006,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(!df_panel_is_nil(panel) && spec != &df_g_nil_view_spec) { DF_View *view = df_view_alloc(); - df_view_equip_spec(ws, view, spec, entity, params.string, params.cfg_node); + df_view_equip_spec(ws, view, spec, entity, params.file_path, params.string, params.cfg_node); df_panel_insert_tab_view(panel, panel->last_tab_view, view); df_panel_notify_mutation(ws, panel); } @@ -2079,18 +2068,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: files case DF_CoreCmdKind_Open: { - DF_Entity *entity = df_entity_from_path(params.file_path, DF_EntityFromPathFlag_OpenAsNeeded|DF_EntityFromPathFlag_OpenMissing); - if(!(entity->flags & DF_EntityFlag_IsMissing) && !(entity->flags & DF_EntityFlag_IsFolder)) - { - DF_CmdParams p = params; - p.window = df_handle_from_window(ws); - p.panel = df_handle_from_panel(ws->focused_panel); - p.entity = df_handle_from_entity(entity); - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Window); - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Panel); - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Entity); - df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_PendingEntity)); - } + DF_CmdParams p = params; + p.window = df_handle_from_window(ws); + p.panel = df_handle_from_panel(ws->focused_panel); + df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_PendingFile)); }break; case DF_CoreCmdKind_Switch: { @@ -2099,7 +2080,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) for(DF_View *v = panel->first_tab_view; !df_view_is_nil(v); v = v->next) { if(df_view_is_project_filtered(v)) { continue; } - DF_Entity *v_param_entity = df_entity_from_handle(v->entity); + DF_Entity *v_param_entity = df_entity_from_handle(v->params_entity); if(v_param_entity == df_entity_from_handle(params.entity)) { panel->selected_tab_view = df_handle_from_view(v); @@ -2116,21 +2097,21 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Window); df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Panel); df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Entity); - df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_PendingEntity)); + df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_PendingFile)); } }break; case DF_CoreCmdKind_SwitchToPartnerFile: { DF_Panel *panel = df_panel_from_handle(params.panel); DF_View *view = df_selected_tab_from_panel(panel); - DF_Entity *entity = df_entity_from_handle(view->entity); DF_GfxViewKind view_kind = df_gfx_view_kind_from_string(view->spec->info.name); - if(view_kind == DF_GfxViewKind_Code && entity->kind == DF_EntityKind_File) + if(view_kind == DF_GfxViewKind_Code) { - String8 file_full_path = df_full_path_from_entity(scratch.arena, entity); + String8 file_path = view->params_file_path; + String8 file_full_path = path_normalized_from_string(scratch.arena, file_path); String8 file_folder = str8_chop_last_slash(file_full_path); - String8 file_name = str8_chop_last_dot(entity->name); - String8 file_ext = str8_skip_last_dot(entity->name); + String8 file_name = str8_skip_last_slash(str8_chop_last_dot(file_full_path)); + String8 file_ext = str8_skip_last_dot(file_full_path); String8 partner_ext_candidates[] = { str8_lit_comp("h"), @@ -2150,10 +2131,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) FileProperties candidate_props = os_properties_from_file_path(candidate_path); if(candidate_props.modified != 0) { - DF_Entity *candidate = df_entity_from_path(candidate_path, DF_EntityFromPathFlag_OpenAsNeeded); - DF_CmdParams p = df_cmd_params_from_panel(ws, panel); - p.entity = df_handle_from_entity(candidate); - df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Switch)); + // TODO(rjf): + //DF_CmdParams p = df_cmd_params_from_panel(ws, panel); + //p.entity = df_handle_from_entity(candidate); + //df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Switch)); break; } } @@ -2583,7 +2564,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_CmdParams params = df_cmd_params_from_window(ws); if(has_line_info) { - params.file_path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(line.file)); + params.file_path = line.file_path; params.text_point = line.pt; df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_FilePath); df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_TextPoint); @@ -2773,7 +2754,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { DF_CmdParams p = params; { - p.file_path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(lines.first->v.file)); + p.file_path = lines.first->v.file_path; p.text_point = lines.first->v.pt; df_cmd_params_mark_slot(&p, DF_CmdParamSlot_FilePath); df_cmd_params_mark_slot(&p, DF_CmdParamSlot_TextPoint); @@ -2853,16 +2834,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SpawnEntityView)); }break; - case DF_EntityKind_File: - { - String8 path = df_full_path_from_entity(scratch.arena, entity); - DF_CmdParams params = df_cmd_params_from_window(ws); - params.file_path = path; - params.text_point = txt_pt(1, 1); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_FilePath); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_TextPoint); - df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); - }break; case DF_EntityKind_Thread: { DF_CmdParams params = df_cmd_params_from_window(ws); @@ -2887,38 +2858,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { default:{}break; - case DF_EntityKind_File: - { - if(entity->flags & DF_EntityFlag_IsFolder) - { - String8 full_path = df_full_path_from_entity(scratch.arena, entity); - String8 full_path_w_slash = push_str8f(scratch.arena, "%S/", full_path); - - // rjf: set current path - { - DF_CmdParams p = df_cmd_params_zero(); - p.file_path = full_path_w_slash; - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_FilePath); - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetCurrentPath)); - } - - // rjf: do fast path for open - { - DF_CmdParams p = df_cmd_params_from_panel(ws, panel); - p.cmd_spec = df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Open); - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_CmdSpec); - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunCommand)); - } - } - else - { - DF_CmdParams params = df_cmd_params_from_panel(ws, panel); - params.entity = df_handle_from_entity(entity); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_CmdSpec); - df_cmd_list_push(arena, cmds, ¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_PendingEntity)); - } - }break; - case DF_EntityKind_Target: { DF_CmdParams params = df_cmd_params_from_panel(ws, panel); @@ -2972,56 +2911,32 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // 4. If there is no empty panel, then we will pick the biggest // panel. - // rjf: grab things to find. file * text, process * address, etc. - DF_Entity *src_code = &df_g_nil_entity; + // rjf: grab things to find. path * point, process * address, etc. + String8 file_path = {0}; TxtPt point = {0}; DF_Entity *thread = &df_g_nil_entity; DF_Entity *process = &df_g_nil_entity; U64 vaddr = 0; { - DF_Entity *param_entity = df_entity_from_handle(params.entity); - if(params.file_path.size != 0) - { - src_code = df_entity_from_path(params.file_path, DF_EntityFromPathFlag_All); - } - if(param_entity->kind == DF_EntityKind_Thread) - { - thread = param_entity; - } - if(param_entity->kind == DF_EntityKind_Thread || - param_entity->kind == DF_EntityKind_Module) - { - process = df_entity_ancestor_from_kind(param_entity, DF_EntityKind_Process); - if(param_entity->kind == DF_EntityKind_Module) - { - thread = df_entity_child_from_kind(process, DF_EntityKind_Thread); - } - } - if(param_entity->kind == DF_EntityKind_Process) - { - process = param_entity; - thread = df_entity_child_from_kind(process, DF_EntityKind_Thread); - } + file_path = params.file_path; point = params.text_point; + thread = df_entity_from_handle(df_interact_regs()->thread); + process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process); vaddr = params.vaddr; } // rjf: given a src code location, and a process, if no vaddr is specified, // try to map the src coordinates to a vaddr via line info - if(vaddr == 0 && !df_entity_is_nil(src_code) && !df_entity_is_nil(process)) + if(vaddr == 0 && file_path.size != 0 && !df_entity_is_nil(process)) { - DF_TextLineSrc2DasmInfoListArray src2dasm = df_text_line_src2dasm_info_list_array_from_src_line_range(scratch.arena, src_code, r1s64(point.line, point.line)); - for(U64 src2dasm_idx = 0; src2dasm_idx < src2dasm.count; src2dasm_idx += 1) + DF_LineList lines = df_lines_from_file_path_line_num(scratch.arena, file_path, point.line); + for(DF_LineNode *n = lines.first; n != 0; n = n->next) { - for(DF_TextLineSrc2DasmInfoNode *n = src2dasm.v[src2dasm_idx].first; n != 0; n = n->next) - { - DF_EntityList modules = df_modules_from_dbgi_key(scratch.arena, &n->v.dbgi_key); - DF_Entity *module = df_module_from_thread_candidates(thread, &modules); - vaddr = df_vaddr_from_voff(module, n->v.voff_range.min); - goto end_lookup; - } + DF_EntityList modules = df_modules_from_dbgi_key(scratch.arena, &n->v.dbgi_key); + DF_Entity *module = df_module_from_thread_candidates(thread, &modules); + vaddr = df_vaddr_from_voff(module, n->v.voff_range.min); + break; } - end_lookup:; } // rjf: first, try to find panel/view pair that already has the src file open @@ -3037,8 +2952,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { if(df_view_is_project_filtered(view)) { continue; } DF_GfxViewKind view_kind = df_gfx_view_kind_from_string(view->spec->info.name); - DF_Entity *viewed_entity = df_entity_from_handle(view->entity); - if((view_kind == DF_GfxViewKind_Code || view_kind == DF_GfxViewKind_PendingEntity) && viewed_entity == src_code) + if((view_kind == DF_GfxViewKind_Code || view_kind == DF_GfxViewKind_PendingFile) && + path_match_normalized(view->params_file_path, file_path)) { panel_w_this_src_code = panel; view_w_this_src_code = view; @@ -3083,7 +2998,6 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { if(df_view_is_project_filtered(view)) { continue; } DF_GfxViewKind view_kind = df_gfx_view_kind_from_string(view->spec->info.name); - DF_Entity *viewed_entity = df_entity_from_handle(view->entity); if(view_kind == DF_GfxViewKind_Disassembly) { panel_w_disasm = panel; @@ -3152,7 +3066,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: given the above, find source code location. B32 disasm_view_prioritized = 0; DF_Panel *panel_used_for_src_code = &df_g_nil_panel; - if(!df_entity_is_nil(src_code)) + if(file_path.size != 0) { // rjf: determine which panel we will use to find the code loc DF_Panel *dst_panel = &df_g_nil_panel; @@ -3168,7 +3082,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(!df_panel_is_nil(dst_panel) && df_view_is_nil(view_w_this_src_code)) { DF_View *view = df_view_alloc(); - df_view_equip_spec(ws, view, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Code), src_code, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, view, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Code), &df_g_nil_entity, file_path, str8_lit(""), &df_g_nil_cfg_node); df_panel_insert_tab_view(dst_panel, dst_panel->last_tab_view, view); dst_view = view; } @@ -3216,7 +3130,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(!df_panel_is_nil(dst_panel) && df_view_is_nil(view_w_disasm)) { DF_View *view = df_view_alloc(); - df_view_equip_spec(ws, view, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Disassembly), &df_g_nil_entity, str8_lit(""), &df_g_nil_cfg_node); + df_view_equip_spec(ws, view, df_view_spec_from_gfx_view_kind(DF_GfxViewKind_Disassembly), &df_g_nil_entity, str8_lit(""), str8_lit(""), &df_g_nil_cfg_node); df_panel_insert_tab_view(dst_panel, dst_panel->last_tab_view, view); dst_view = view; } @@ -3686,8 +3600,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) Handle(module); Handle(process); Handle(thread); - Handle(file); #undef Handle + ui_labelf("file_path: \"%S\"", regs->file_path); ui_labelf("cursor: (L:%I64d, C:%I64d)", regs->cursor.line, regs->cursor.column); ui_labelf("mark: (L:%I64d, C:%I64d)", regs->mark.line, regs->mark.column); ui_labelf("unwind_count: %I64u", regs->unwind_count); @@ -3812,7 +3726,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread); U64 new_rip_vaddr = ws->code_ctx_menu_vaddr; - if(!df_entity_is_nil(df_entity_from_handle(ws->code_ctx_menu_file))) + if(ws->code_ctx_menu_file_path.size != 0) { for(DF_LineNode *n = lines.first; n != 0; n = n->next) { @@ -3833,10 +3747,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Play, 0, "Run To Line"))) { - if(!df_entity_is_nil(df_entity_from_handle(ws->code_ctx_menu_file))) + if(ws->code_ctx_menu_file_path.size != 0) { DF_CmdParams p = df_cmd_params_from_window(ws); - p.entity = ws->code_ctx_menu_file; + p.file_path = ws->code_ctx_menu_file_path; p.text_point = range.min; df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunToLine)); } @@ -3879,7 +3793,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) else { DF_CmdParams p = df_cmd_params_from_window(ws); - p.entity = ws->code_ctx_menu_file; + p.file_path = ws->code_ctx_menu_file_path; p.text_point = range.min; df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_TextBreakpoint)); } @@ -3905,12 +3819,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchExpression)); ui_ctx_menu_close(); } - if(df_entity_is_nil(df_entity_from_handle(ws->code_ctx_menu_file)) && range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_FileOutline, 0, "Go To Source"))) + if(ws->code_ctx_menu_file_path.size == 0 && range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_FileOutline, 0, "Go To Source"))) { if(lines.first != 0) { DF_CmdParams params = df_cmd_params_from_window(ws); - params.file_path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(lines.first->v.file)); + params.file_path = lines.first->v.file_path; params.text_point = lines.first->v.pt; df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_FilePath); df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_TextPoint); @@ -3918,7 +3832,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } ui_ctx_menu_close(); } - if(!df_entity_is_nil(df_entity_from_handle(ws->code_ctx_menu_file)) && range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_FileOutline, 0, "Go To Disassembly"))) + if(ws->code_ctx_menu_file_path.size != 0 && range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_FileOutline, 0, "Go To Disassembly"))) { DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread); U64 vaddr = 0; @@ -4131,7 +4045,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: enabling if(op_flags & DF_EntityOpFlag_Enable) { - B32 is_enabled = entity->b32; + B32 is_enabled = !entity->disabled; if(!is_enabled && ui_clicked(df_icon_buttonf(ws, DF_IconKind_CheckHollow, 0, "Enable###enabler"))) { DF_CmdParams params = df_cmd_params_from_window(ws); @@ -4499,7 +4413,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_Panel *panel = df_panel_from_handle(ws->tab_ctx_menu_panel); DF_View *view = df_view_from_handle(ws->tab_ctx_menu_view); DF_IconKind view_icon = df_icon_kind_from_view(view); - DF_Entity *entity = df_entity_from_handle(view->entity); + String8 file_path = view->params_file_path; String8 display_name = df_display_string_from_view(scratch.arena, view); // rjf: title @@ -4526,10 +4440,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } // rjf: copy full path - if(entity->kind == DF_EntityKind_File) + if(file_path.size != 0) { UI_Signal copy_full_path_sig = df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Full Path"); - String8 full_path = df_full_path_from_entity(scratch.arena, entity); + String8 full_path = path_normalized_from_string(scratch.arena, file_path); if(ui_clicked(copy_full_path_sig)) { os_set_clipboard_text(full_path); @@ -4542,12 +4456,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } // rjf: show in explorer - if(entity->kind == DF_EntityKind_File) + if(file_path.size != 0) { UI_Signal sig = df_icon_buttonf(ws, DF_IconKind_FolderClosedFilled, 0, "Show In Explorer"); if(ui_clicked(sig)) { - String8 full_path = df_full_path_from_entity(scratch.arena, entity); + String8 full_path = path_normalized_from_string(scratch.arena, file_path); os_show_in_filesystem_ui(full_path); ui_ctx_menu_close(); } @@ -5958,7 +5872,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: construct & push new view DF_View *view = df_view_alloc(); - df_view_equip_spec(ws, view, view_spec, &df_g_nil_entity, default_query, &df_g_nil_cfg_node); + df_view_equip_spec(ws, view, view_spec, &df_g_nil_entity, str8_lit(""), default_query, &df_g_nil_cfg_node); if(cmd_spec->info.query.flags & DF_CmdQueryFlag_SelectOldInput) { view->query_mark = txt_pt(1, 1); @@ -6428,7 +6342,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchExpression)); } } - if(!df_entity_is_nil(df_entity_from_handle(ws->hover_eval_file)) || ws->hover_eval_vaddr != 0) + if(ws->hover_eval_file_path.size != 0 || ws->hover_eval_vaddr != 0) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(3.f, 1.f)) UI_CornerRadius10(corner_radius) UI_CornerRadius11(corner_radius) @@ -6445,20 +6359,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(ui_clicked(pin_sig)) { DF_CmdParams params = df_cmd_params_from_window(ws); - if(ws->hover_eval_vaddr != 0) - { - params.vaddr = ws->hover_eval_vaddr; - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualAddr); - } - else - { - params.entity = ws->hover_eval_file; - params.text_point = ws->hover_eval_file_pt; - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_TextPoint); - } + params.file_path = ws->hover_eval_file_path; + params.text_point = ws->hover_eval_file_pt; + params.vaddr = ws->hover_eval_vaddr; params.string = expr; - df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_String); df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchPin)); } } @@ -7230,15 +7134,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) df_push_interact_regs(); { DF_View *view = df_selected_tab_from_panel(panel); - DF_Entity *entity = df_entity_from_handle(view->entity); df_interact_regs()->cursor = view->cursor; df_interact_regs()->mark = view->mark; - df_interact_regs()->file = df_handle_zero(); - switch(entity->kind) - { - default:{}break; - case DF_EntityKind_File:{df_interact_regs()->file = view->entity;}break; - } + df_interact_regs()->file_path = view->params_file_path; } //- rjf: build view container @@ -9208,7 +9106,7 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DI_Scope *scope, //~ rjf: Hover Eval internal void -df_set_hover_eval(DF_Window *ws, Vec2F32 pos, DF_Entity *file, TxtPt pt, U64 vaddr, String8 string) +df_set_hover_eval(DF_Window *ws, Vec2F32 pos, String8 file_path, TxtPt pt, U64 vaddr, String8 string) { if(ws->hover_eval_last_frame_idx+1 < df_frame_index() && ui_key_match(ui_active_key(UI_MouseButtonKind_Left), ui_key_zero()) && @@ -9221,7 +9119,7 @@ df_set_hover_eval(DF_Window *ws, Vec2F32 pos, DF_Entity *file, TxtPt pt, U64 vad ws->hover_eval_first_frame_idx = ws->hover_eval_last_frame_idx = df_frame_index(); arena_clear(ws->hover_eval_arena); ws->hover_eval_string = push_str8_copy(ws->hover_eval_arena, string); - ws->hover_eval_file = df_handle_from_entity(file); + ws->hover_eval_file_path = push_str8_copy(ws->hover_eval_arena, file_path); ws->hover_eval_file_pt = pt; ws->hover_eval_vaddr = vaddr; ws->hover_eval_focused = 0; @@ -9857,7 +9755,6 @@ df_cfg_strings_from_gfx(Arena *arena, String8 root_path, DF_CfgSrc source) for(DF_View *view = p->first_tab_view; !df_view_is_nil(view); view = view->next) { String8 view_string = view->spec->info.name; - DF_Entity *view_entity = df_entity_from_handle(view->entity); // rjf: serialize views which can be serialized if(view->spec->info.flags & DF_ViewSpecFlag_CanSerialize) @@ -9874,11 +9771,10 @@ df_cfg_strings_from_gfx(Arena *arena, String8 root_path, DF_CfgSrc source) str8_list_push(arena, &strs, str8_lit("selected ")); } { - DF_Entity *project = df_entity_from_handle(view->project); - if(!df_entity_is_nil(project)) + if(view->project_path.size != 0) { Temp scratch = scratch_begin(&arena, 1); - String8 project_path_absolute = df_full_path_from_entity(scratch.arena, project); + String8 project_path_absolute = path_normalized_from_string(scratch.arena, view->project_path); String8 project_path_relative = path_relative_dst_from_absolute_dst_src(scratch.arena, project_path_absolute, root_path); str8_list_pushf(arena, &strs, "project:{\"%S\"} ", project_path_relative); scratch_end(scratch); @@ -9892,15 +9788,15 @@ df_cfg_strings_from_gfx(Arena *arena, String8 root_path, DF_CfgSrc source) str8_list_pushf(arena, &strs, "query:{\"%S\"} ", query_sanitized); scratch_end(scratch); } - if(view->spec->info.flags & DF_ViewSpecFlag_CanSerializeEntityPath) + if(view->spec->info.flags & DF_ViewSpecFlag_CanSerializeFilePath && + view->params_file_path.size != 0) { - if(view_entity->kind == DF_EntityKind_File) - { - String8 project_path = root_path; - String8 entity_path = df_full_path_from_entity(arena, view_entity); - String8 entity_path_rel = path_relative_dst_from_absolute_dst_src(arena, entity_path, project_path); - str8_list_pushf(arena, &strs, "\"%S\"", entity_path_rel); - } + Temp scratch = scratch_begin(&arena, 1); + String8 project_path = root_path; + String8 file_path = path_normalized_from_string(scratch.arena, view->params_file_path); + String8 file_path_rel = path_relative_dst_from_absolute_dst_src(scratch.arena, file_path, project_path); + str8_list_pushf(arena, &strs, "\"%S\"", file_path_rel); + scratch_end(scratch); } String8 view_state_string = view->spec->info.string_from_state_hook(arena, view); str8_list_push(arena, &strs, view_state_string); @@ -10735,7 +10631,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam { palette = df_palette_from_code(ws, DF_PaletteCode_NeutralPopButton); } - else if(entity->kind == DF_EntityKind_Target && entity->b32 != 0) + else if(entity->kind == DF_EntityKind_Target && !entity->disabled) { palette = df_palette_from_code(ws, DF_PaletteCode_NeutralPopButton); } @@ -10806,7 +10702,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam DF_Entity *args = df_entity_child_from_kind(entity, DF_EntityKind_Arguments); ui_label(args->name); } - if(op_flags & DF_EntityOpFlag_Enable && entity->b32 == 0) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_FontSize(ui_top_font_size()*0.95f) UI_HeightFill + if(op_flags & DF_EntityOpFlag_Enable && entity->disabled) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_FontSize(ui_top_font_size()*0.95f) UI_HeightFill { ui_label(str8_lit("(Disabled)")); } @@ -10863,7 +10759,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam df_entity_tooltips(ws, entity); } - // rjf: click => fastpath or dropdown for this entity + // rjf: click => fastpath for this entity if(ui_clicked(sig)) { DF_CmdParams params = df_cmd_params_from_window(ws); @@ -10895,11 +10791,10 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam } internal void -df_entity_src_loc_button(DF_Window *ws, DF_Entity *entity, TxtPt point) +df_src_loc_button(DF_Window *ws, String8 file_path, TxtPt point) { Temp scratch = scratch_begin(0, 0); - String8 full_path = df_full_path_from_entity(scratch.arena, entity); - String8 filename = str8_skip_last_slash(full_path); + String8 filename = str8_skip_last_slash(file_path); // rjf: build main box ui_set_next_hover_cursor(OS_Cursor_HandPoint); @@ -10908,13 +10803,13 @@ df_entity_src_loc_button(DF_Window *ws, DF_Entity *entity, TxtPt point) UI_BoxFlag_DrawBackground| UI_BoxFlag_DrawHotEffects| UI_BoxFlag_DrawActiveEffects, - "entity_file_ref_button_%p", entity); + "file_loc_button_%S", file_path); UI_Signal sig = ui_signal_from_box(box); // rjf: build contents UI_Parent(box) UI_PrefWidth(ui_text_dim(10, 0)) { - DF_IconKind icon = df_g_entity_kind_icon_kind_table[entity->kind]; + DF_IconKind icon = DF_IconKind_FileOutline; UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_TextAlignment(UI_TextAlign_Center) DF_Font(ws, DF_FontSlot_Icons) @@ -10927,27 +10822,17 @@ df_entity_src_loc_button(DF_Window *ws, DF_Entity *entity, TxtPt point) if(ui_clicked(sig)) { DF_CmdParams params = df_cmd_params_from_window(ws); - params.file_path = full_path; + params.file_path = file_path; params.text_point = point; df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_FilePath); df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_TextPoint); df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); } - // rjf: drag+drop - else if(ui_dragging(sig) && !contains_2f32(box->rect, ui_mouse())) - { - DF_DragDropPayload payload = {0}; - payload.key = box->key; - payload.entity = df_handle_from_entity(entity); - payload.text_point = point; - df_drag_begin(&payload); - } - // rjf: hover => show full path else if(ui_hovering(sig) && !ui_dragging(sig)) UI_Tooltip { - ui_labelf("%S:%I64d:%I64d", full_path, point.line, point.column); + ui_labelf("%S:%I64d:%I64d", file_path, point.line, point.column); } scratch_end(scratch); } @@ -11415,7 +11300,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m // rjf: fill out progress t (progress into range of current line's // voff range) - if(!df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file)) && params->line_infos[line_idx].first != 0) + if(df_interact_regs()->file_path.size != 0 && params->line_infos[line_idx].first != 0) { DF_LineList *lines = ¶ms->line_infos[line_idx]; DF_Line *line = 0; @@ -11482,7 +11367,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m { bp_color = df_rgba_from_entity(bp); } - if(bp->b32 == 0) + if(bp->disabled) { bp_color = v4f32(bp_color.x * 0.6f, bp_color.y * 0.6f, bp_color.z * 0.6f, bp_color.w * 0.6f); } @@ -11494,7 +11379,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m bp_draw->alive_t = bp->alive_t; bp_draw->do_lines = df_setting_val_from_code(ws, DF_SettingCode_BreakpointLines).s32; bp_draw->do_glow = df_setting_val_from_code(ws, DF_SettingCode_BreakpointGlow).s32; - if(!df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file))) + if(df_interact_regs()->file_path.size != 0) { DF_LineList *lines = ¶ms->line_infos[line_idx]; for(DF_LineNode *n = lines->first; n != 0; n = n->next) @@ -11625,20 +11510,11 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m UI_Signal line_margin_sig = ui_signal_from_box(line_margin_box); if(ui_clicked(line_margin_sig)) { - if(!df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file))) - { - TxtPt pt = txt_pt(line_num, 1); - DF_CmdParams p = df_cmd_params_from_window(ws); - p.entity = df_interact_regs()->file; - p.text_point = pt; - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_TextBreakpoint)); - } - else if(params->line_vaddrs[line_idx] != 0) - { - DF_CmdParams p = df_cmd_params_from_window(ws); - p.vaddr = params->line_vaddrs[line_idx]; - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_AddressBreakpoint)); - } + DF_CmdParams p = df_cmd_params_from_window(ws); + p.file_path = df_interact_regs()->file_path; + p.text_point = txt_pt(line_num, 1); + p.vaddr = params->line_vaddrs[line_idx]; + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_AddBreakpoint)); } } } @@ -11681,7 +11557,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m { if(n->v.dbgi_key.min_timestamp >= best_stamp) { - has_line_info = (n->v.pt.line == line_num || df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file))); + has_line_info = (n->v.pt.line == line_num || df_interact_regs()->file_path.size == 0); line_info_line_num = n->v.pt.line; best_stamp = n->v.dbgi_key.min_timestamp; } @@ -11861,7 +11737,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m UI_Signal pin_sig = ui_signal_from_box(pin_box); if(ui_key_match(pin_box_key, ui_hot_key())) { - df_set_hover_eval(ws, v2f32(pin_box->rect.x0, pin_box->rect.y1-2.f), &df_g_nil_entity, txt_pt(1, 1), 0, pin_expr); + df_set_hover_eval(ws, v2f32(pin_box->rect.x0, pin_box->rect.y1-2.f), str8_zero(), txt_pt(1, 1), 0, pin_expr); } } } @@ -11993,7 +11869,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m } ui_ctx_menu_open(ws->code_ctx_menu_key, ui_key_zero(), sub_2f32(ui_mouse(), v2f32(2, 2))); arena_clear(ws->code_ctx_menu_arena); - ws->code_ctx_menu_file = df_interact_regs()->file; + ws->code_ctx_menu_file_path = push_str8_copy(ws->code_ctx_menu_arena, df_interact_regs()->file_path); ws->code_ctx_menu_text_key = df_interact_regs()->text_key; ws->code_ctx_menu_lang_kind = df_interact_regs()->lang_kind; ws->code_ctx_menu_range = txt_rng(*cursor, *mark); @@ -12036,25 +11912,17 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m case DF_EntityKind_Breakpoint: case DF_EntityKind_WatchPin: { - if(!df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file))) - { - df_entity_change_parent(dropped_entity, dropped_entity->parent, df_entity_from_handle(df_interact_regs()->file), &df_g_nil_entity); - df_entity_equip_txt_pt(dropped_entity, txt_pt(line_num, 1)); - if(dropped_entity->flags & DF_EntityFlag_HasVAddr) - { - dropped_entity->flags &= ~DF_EntityFlag_HasVAddr; - } - } - else if(line_vaddr != 0) - { - df_entity_change_parent(dropped_entity, dropped_entity->parent, df_entity_root(), &df_g_nil_entity); - df_entity_equip_vaddr(dropped_entity, line_vaddr); - } + DF_CmdParams p = df_cmd_params_zero(); + p.entity = df_handle_from_entity(dropped_entity); + p.file_path = df_interact_regs()->file_path; + p.text_point = txt_pt(line_num, 1); + p.vaddr = line_vaddr; + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RelocateEntity)); }break; case DF_EntityKind_Thread: { U64 new_rip_vaddr = line_vaddr; - if(!df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file))) + if(df_interact_regs()->file_path.size != 0) { DF_LineList *lines = ¶ms->line_infos[line_idx]; for(DF_LineNode *n = lines->first; n != 0; n = n->next) @@ -12128,7 +11996,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m { U64 line_slice_idx = mouse_pt.line-params->line_num_range.min; DF_LineList *lines = ¶ms->line_infos[line_slice_idx]; - if(lines->first != 0 && (df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file)) || lines->first->v.pt.line == mouse_pt.line)) + if(lines->first != 0 && (df_interact_regs()->file_path.size == 0 || lines->first->v.pt.line == mouse_pt.line)) { DF_RichHoverInfo info = {0}; info.process = df_handle_from_entity(selected_thread_process); @@ -12154,7 +12022,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m U64 line_idx = mouse_pt.line-params->line_num_range.min; line_vaddr = params->line_vaddrs[line_idx]; } - df_set_hover_eval(ws, mouse_expr_baseline_pos, df_entity_from_handle(df_interact_regs()->file), mouse_pt, line_vaddr, mouse_expr); + df_set_hover_eval(ws, mouse_expr_baseline_pos, df_interact_regs()->file_path, mouse_pt, line_vaddr, mouse_expr); } } @@ -12517,7 +12385,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m DF_LineList *lines = ¶ms->line_infos[line_idx]; for(DF_LineNode *n = lines->first; n != 0; n = n->next) { - if((n->v.pt.line == line_num || df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file))) && + if((n->v.pt.line == line_num || df_interact_regs()->file_path.size == 0) && ((di_key_match(&n->v.dbgi_key, &rich_hover.dbgi_key) && n->v.voff_range.min <= rich_hover_voff_range.min && rich_hover_voff_range.min < n->v.voff_range.max) || (params->line_vaddrs[line_idx] == rich_hover.vaddr_range.min && rich_hover.vaddr_range.min != 0))) @@ -14096,20 +13964,21 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) view_query = df_cfg_raw_from_escaped_string(scratch.arena, escaped_query); } - // rjf: read entity path - DF_Entity *entity = &df_g_nil_entity; - if(view_spec_flags & DF_ViewSpecFlag_CanSerializeEntityPath) + // rjf: read path + String8 file_path = {0}; + if(view_spec_flags & DF_ViewSpecFlag_CanSerializeFilePath) { String8 saved_path = df_first_cfg_node_child_from_flags(op, DF_CfgNodeFlag_StringLiteral)->string; String8 saved_path_absolute = path_absolute_dst_from_relative_dst_src(scratch.arena, saved_path, cfg_folder); - entity = df_entity_from_path(saved_path_absolute, DF_EntityFromPathFlag_All); + file_path = saved_path_absolute; } // rjf: set up view - df_view_equip_spec(ws, view, view_spec, entity, view_query, op); + df_view_equip_spec(ws, view, view_spec, &df_g_nil_entity, file_path, view_query, op); if(project_path.size != 0) { - view->project = df_handle_from_entity(df_entity_from_path(project_path, DF_EntityFromPathFlag_OpenMissing|DF_EntityFromPathFlag_OpenAsNeeded)); + arena_clear(view->project_path_arena); + view->project_path = push_str8_copy(view->project_path_arena, project_path); } } @@ -14117,7 +13986,6 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) if(!df_view_is_nil(view)) { DF_Entity *current_project = df_entity_from_path(df_cfg_path_from_src(DF_CfgSrc_Project), DF_EntityFromPathFlag_OpenMissing|DF_EntityFromPathFlag_OpenAsNeeded); - DF_Entity *view_project = df_entity_from_handle(view->project); df_panel_insert_tab_view(panel, panel->last_tab_view, view); if(view_is_selected) { @@ -14493,7 +14361,8 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds) String8 path = df_cfg_path_from_src(src); String8List strs = df_cfg_strings_from_gfx(scratch.arena, path, src); String8 data = str8_list_join(scratch.arena, &strs, 0); - df_cfg_push_write_string(src, data); + String8 data_indented = indented_from_string(scratch.arena, data); + df_cfg_push_write_string(src, data_indented); } }break; diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index e699fc1c..34878721 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -112,28 +112,19 @@ enum DF_ViewSpecFlag_ParameterizedByEntity = (1<<0), DF_ViewSpecFlag_ProjectSpecific = (1<<1), DF_ViewSpecFlag_CanSerialize = (1<<2), - DF_ViewSpecFlag_CanSerializeEntityPath = (1<<3), + DF_ViewSpecFlag_CanSerializeFilePath = (1<<3), DF_ViewSpecFlag_CanSerializeQuery = (1<<4), DF_ViewSpecFlag_CanFilter = (1<<5), DF_ViewSpecFlag_FilterIsCode = (1<<6), DF_ViewSpecFlag_TypingAutomaticallyFilters = (1<<7), }; -typedef enum DF_NameKind -{ - DF_NameKind_Null, - DF_NameKind_EntityName, - DF_NameKind_COUNT -} -DF_NameKind; - typedef struct DF_ViewSpecInfo DF_ViewSpecInfo; struct DF_ViewSpecInfo { DF_ViewSpecFlags flags; String8 name; String8 display_string; - DF_NameKind name_kind; DF_IconKind icon_kind; DF_ViewSetupFunctionType *setup_hook; DF_ViewStringFromStateFunctionType *string_from_state_hook; @@ -188,6 +179,9 @@ struct DF_View DF_View *next; DF_View *prev; + // rjf: view specification info + DF_ViewSpec *spec; + // rjf: allocation info U64 generation; @@ -197,27 +191,31 @@ struct DF_View U64 loading_progress_v; U64 loading_progress_v_target; + // rjf: view project (for project-specific/filtered views) + Arena *project_path_arena; + String8 project_path; + + // rjf: view specification parameters + Arena *params_arena; + DF_Handle params_entity; + String8 params_file_path; + // rjf: view state UI_ScrollPt2 scroll_pos; TxtPt cursor; TxtPt mark; - // rjf: allocation & user data extensions + // rjf: view-lifetime allocation & user data extensions Arena *arena; DF_ArenaExt *first_arena_ext; DF_ArenaExt *last_arena_ext; void *user_data; - // rjf: view kind info - DF_ViewSpec *spec; - DF_Handle entity; - DF_Handle project; - // rjf: filter mode B32 is_filtering; F32 is_filtering_t; - // rjf: query -> params data + // rjf: text query state TxtPt query_cursor; TxtPt query_mark; U8 query_buffer[1024]; @@ -574,7 +572,7 @@ struct DF_Window // rjf: code context menu state Arena *code_ctx_menu_arena; UI_Key code_ctx_menu_key; - DF_Handle code_ctx_menu_file; + String8 code_ctx_menu_file_path; U128 code_ctx_menu_text_key; TXT_LangKind code_ctx_menu_lang_kind; TxtRng code_ctx_menu_range; @@ -632,7 +630,7 @@ struct DF_Window U64 hover_eval_last_frame_idx; // rjf: hover eval params - DF_Handle hover_eval_file; + String8 hover_eval_file_path; TxtPt hover_eval_file_pt; U64 hover_eval_vaddr; F32 hover_eval_open_t; @@ -800,7 +798,6 @@ read_only global DF_ViewSpec df_g_nil_view_spec = 0, {0}, {0}, - DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(Null), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Null), @@ -818,20 +815,7 @@ read_only global DF_View df_g_nil_view = { &df_g_nil_view, &df_g_nil_view, - 0, - 0, - 0, - 0, - 0, - {0}, - {0}, - {0}, - 0, - 0, - 0, - 0, &df_g_nil_view_spec, - {0}, }; read_only global DF_Panel df_g_nil_panel = @@ -841,7 +825,6 @@ read_only global DF_Panel df_g_nil_panel = &df_g_nil_panel, &df_g_nil_panel, &df_g_nil_panel, - 0, }; global DF_GfxState *df_gfx_state = 0; @@ -949,7 +932,7 @@ internal DF_ViewSpec *df_tab_view_spec_from_gfx_view_rule_spec(DF_GfxViewRuleSpe internal DF_View *df_view_alloc(void); internal void df_view_release(DF_View *view); -internal void df_view_equip_spec(DF_Window *window, DF_View *view, DF_ViewSpec *spec, DF_Entity *entity, String8 default_query, DF_CfgNode *cfg_root); +internal void df_view_equip_spec(DF_Window *window, DF_View *view, DF_ViewSpec *spec, DF_Entity *entity, String8 file_path, String8 default_query, DF_CfgNode *cfg_root); internal void df_view_equip_loading_info(DF_View *view, B32 is_loading, U64 progress_v, U64 progress_target); internal void df_view_clear_user_state(DF_View *view); internal void *df_view_get_or_push_user_state(DF_View *view, U64 size); @@ -989,7 +972,7 @@ internal DF_EvalVizWindowedRowList df_eval_viz_windowed_row_list_from_viz_block_ //////////////////////////////// //~ rjf: Hover Eval -internal void df_set_hover_eval(DF_Window *ws, Vec2F32 pos, DF_Entity *file, TxtPt pt, U64 vaddr, String8 string); +internal void df_set_hover_eval(DF_Window *ws, Vec2F32 pos, String8 file_path, TxtPt pt, U64 vaddr, String8 string); //////////////////////////////// //~ rjf: Auto-Complete Lister @@ -1063,7 +1046,7 @@ internal UI_Signal df_icon_button(DF_Window *ws, DF_IconKind kind, FuzzyMatchRan internal UI_Signal df_icon_buttonf(DF_Window *ws, DF_IconKind kind, FuzzyMatchRangeList *matches, char *fmt, ...); internal void df_entity_tooltips(DF_Window *ws, DF_Entity *entity); internal UI_Signal df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *name_matches, String8 fuzzy_query, B32 is_implicit); -internal void df_entity_src_loc_button(DF_Window *ws, DF_Entity *entity, TxtPt point); +internal void df_src_loc_button(DF_Window *ws, String8 file_path, TxtPt point); //////////////////////////////// //~ rjf: UI Widgets: Text View diff --git a/src/df/gfx/df_gfx.mdesk b/src/df/gfx/df_gfx.mdesk index 7d4d39d6..54e04694 100644 --- a/src/df/gfx/df_gfx.mdesk +++ b/src/df/gfx/df_gfx.mdesk @@ -208,40 +208,40 @@ DF_BindingVersionRemapTable: //////////////////////////////// //~ rjf: Gfx Layer View Kinds -@table(name, name_lower, display_string, name_kind, icon, parameterized_by_entity, project_specific, can_serialize, can_serialize_entity_path, can_filter, filter_is_code, typing_automatically_filters, inc_in_docs, docs_desc) +@table(name, name_lower, display_string, icon, parameterized_by_entity, project_specific, can_serialize, can_serialize_file_path, can_filter, filter_is_code, typing_automatically_filters, inc_in_docs, docs_desc) DF_GfxViewTable: { - { Null "null" "" Null Null 0 0 0 0 0 0 0 0 "" } - { Empty "empty" "" Null Null 0 0 0 0 0 0 0 0 "" } - { GettingStarted "getting_started" "Getting Started" Null QuestionMark 0 0 1 0 0 0 0 0 "" } - { Commands "commands" "Commands" Null List 0 0 0 0 0 0 0 0 "" } - { FileSystem "file_system" "File System" Null FileOutline 0 0 0 0 0 0 0 0 "" } - { SystemProcesses "system_processes" "System Processes" Null Null 0 0 0 0 0 0 0 0 "" } - { EntityLister "entity_lister" "Entity List" Null Null 0 0 0 0 0 0 0 0 "" } - { SymbolLister "symbol_lister" "Symbols" Null Null 0 0 0 0 0 0 0 0 "" } - { Target "target" "Target" EntityName Target 1 0 0 0 0 0 0 0 "" } - { Targets "targets" "Targets" Null Target 0 0 1 0 1 0 1 1 "Displays a list of all targets, as well as controls for enabling, disabling, launching, editing, or deleting each target. For more information on targets, read the `Targets` section." } - { FilePathMap "file_path_map" "File Path Map" Null FileOutline 0 0 1 0 0 0 0 1 "Displays a table of *path maps*. Each path map is a pair of file or folder paths, one being a 'source' path, and one being a 'destination' path. These pairs are used by the debugger when automatically searching for specific files - for instance, when attempting to snap to a source code location specified by debug info. If debug info refers to a path on the machine on which a target executable was originally built, but that path is not valid on the debugger machine, but some alternative path exists, then path maps may be used to redirect the debugger from the debug info's specified paths to the associated appropriate debugger machine file paths." } - { AutoViewRules "auto_view_rules" "Auto View Rules" Null Binoculars 0 0 1 0 0 0 0 1 "Displays a table of *auto view rules*. Each *auto view rule* is a pair, with one element being a type, and the other being a view rule, which should be automatically applied to expressions of that type, when possible." } - { Scheduler "scheduler" "Scheduler" Null Scheduler 0 0 1 0 1 1 1 1 "Displays all processes and threads to which the debugger is currently attached, and contains controls for selecting and freezing threads." } - { CallStack "call_stack" "Call Stack" Null Thread 0 0 1 0 0 0 0 1 "Displays the call stack of the currently selected thread. Each frame in the call stack contains the associated module, function name, and return address. Allows selection of a particular call stack frame other than the top." } - { Modules "modules" "Modules" Null Module 0 0 1 0 1 0 1 1 "Displays a table of all modules currently loaded by any process to which the debugger is attached. This table displays each module's name, virtual address range in the containing process' address space, and which debug info file is being used by the debugger for the associated module." } - { PendingEntity "pending_entity" "Pending Entity" EntityName FileOutline 1 0 0 0 0 0 0 0 "" } - { Code "code" "Code" EntityName FileOutline 1 1 1 1 0 0 0 0 "" } - { Disassembly "disassembly" "Disassembly" Null Glasses 0 0 1 0 0 0 0 1 "Displays disassembled instructions in a textual form from the selected thread's containing process virtual address space." } - { Watch "watch" "Watch" Null Binoculars 0 0 1 0 1 1 1 1 "The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section." } - { Locals "locals" "Locals" Null Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with local variables found within the selected call stack frame of the selected thread, according to the associated debug info. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { Registers "registers" "Registers" Null Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all register names according to the selected thread's architecture. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { Globals "globals" "Globals" Null Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all global variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { ThreadLocals "thread_locals" "Thread Locals" Null Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all thread local variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { Types "types" "Types" Null Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all types within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { Procedures "procedures" "Procedures" Null Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all procedures within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } - { Output "output" "Output" Null List 0 0 1 0 0 0 0 1 "Displays textual output from the selected thread's containing process." } - { Memory "memory" "Memory" Null Grid 0 0 1 0 0 0 0 1 "A familiar hex-editor-like interface for viewing memory of attached processes." } - { Breakpoints "breakpoints" "Breakpoints" Null CircleFilled 0 0 1 0 1 0 1 1 "Displays a table of all breakpoints, containing information about each breakpoint's name, location, and hit count. Also contains per-breakpoint controls for enabling, deleting, or editing each breakpoint. For more information on breakpoints and their features, read the 'Breakpoints' section." } - { WatchPins "watch_pins" "Watch Pins" Null Pin 0 0 1 0 1 1 1 1 "Displays a table of all watch pins (watched expressions, like those found in `Watch`, but instead of being within a table, being pinned to some source code location, like breakpoints). This table contains each pin's name, location, and controls for editing or deleting each pin." } - { ExceptionFilters "exception_filters" "Exception Filters" Null Gear 0 0 1 0 1 0 1 1 "An interface which controls whether or not the debugger will halt attached processes upon encountering specific exception codes for the first time." } - { Settings "settings" "Settings" Null Gear 0 0 1 0 1 0 1 1 "An interface to modify general settings for the debugger's appearance and behavior." } + { Null "null" "" Null 0 0 0 0 0 0 0 0 "" } + { Empty "empty" "" Null 0 0 0 0 0 0 0 0 "" } + { GettingStarted "getting_started" "Getting Started" QuestionMark 0 0 1 0 0 0 0 0 "" } + { Commands "commands" "Commands" List 0 0 0 0 0 0 0 0 "" } + { FileSystem "file_system" "File System" FileOutline 0 0 0 0 0 0 0 0 "" } + { SystemProcesses "system_processes" "System Processes" Null 0 0 0 0 0 0 0 0 "" } + { EntityLister "entity_lister" "Entity List" Null 0 0 0 0 0 0 0 0 "" } + { SymbolLister "symbol_lister" "Symbols" Null 0 0 0 0 0 0 0 0 "" } + { Target "target" "Target" Target 1 0 0 0 0 0 0 0 "" } + { Targets "targets" "Targets" Target 0 0 1 0 1 0 1 1 "Displays a list of all targets, as well as controls for enabling, disabling, launching, editing, or deleting each target. For more information on targets, read the `Targets` section." } + { FilePathMap "file_path_map" "File Path Map" FileOutline 0 0 1 0 0 0 0 1 "Displays a table of *path maps*. Each path map is a pair of file or folder paths, one being a 'source' path, and one being a 'destination' path. These pairs are used by the debugger when automatically searching for specific files - for instance, when attempting to snap to a source code location specified by debug info. If debug info refers to a path on the machine on which a target executable was originally built, but that path is not valid on the debugger machine, but some alternative path exists, then path maps may be used to redirect the debugger from the debug info's specified paths to the associated appropriate debugger machine file paths." } + { AutoViewRules "auto_view_rules" "Auto View Rules" Binoculars 0 0 1 0 0 0 0 1 "Displays a table of *auto view rules*. Each *auto view rule* is a pair, with one element being a type, and the other being a view rule, which should be automatically applied to expressions of that type, when possible." } + { Scheduler "scheduler" "Scheduler" Scheduler 0 0 1 0 1 1 1 1 "Displays all processes and threads to which the debugger is currently attached, and contains controls for selecting and freezing threads." } + { CallStack "call_stack" "Call Stack" Thread 0 0 1 0 0 0 0 1 "Displays the call stack of the currently selected thread. Each frame in the call stack contains the associated module, function name, and return address. Allows selection of a particular call stack frame other than the top." } + { Modules "modules" "Modules" Module 0 0 1 0 1 0 1 1 "Displays a table of all modules currently loaded by any process to which the debugger is attached. This table displays each module's name, virtual address range in the containing process' address space, and which debug info file is being used by the debugger for the associated module." } + { PendingFile "pending_file" "Pending File" FileOutline 1 0 0 0 0 0 0 0 "" } + { Code "code" "Code" FileOutline 1 1 1 1 0 0 0 0 "" } + { Disassembly "disassembly" "Disassembly" Glasses 0 0 1 0 0 0 0 1 "Displays disassembled instructions in a textual form from the selected thread's containing process virtual address space." } + { Watch "watch" "Watch" Binoculars 0 0 1 0 1 1 1 1 "The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section." } + { Locals "locals" "Locals" Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with local variables found within the selected call stack frame of the selected thread, according to the associated debug info. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } + { Registers "registers" "Registers" Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all register names according to the selected thread's architecture. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } + { Globals "globals" "Globals" Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all global variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } + { ThreadLocals "thread_locals" "Thread Locals" Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all thread local variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } + { Types "types" "Types" Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all types within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } + { Procedures "procedures" "Procedures" Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all procedures within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } + { Output "output" "Output" List 0 0 1 0 0 0 0 1 "Displays textual output from the selected thread's containing process." } + { Memory "memory" "Memory" Grid 0 0 1 0 0 0 0 1 "A familiar hex-editor-like interface for viewing memory of attached processes." } + { Breakpoints "breakpoints" "Breakpoints" CircleFilled 0 0 1 0 1 0 1 1 "Displays a table of all breakpoints, containing information about each breakpoint's name, location, and hit count. Also contains per-breakpoint controls for enabling, deleting, or editing each breakpoint. For more information on breakpoints and their features, read the 'Breakpoints' section." } + { WatchPins "watch_pins" "Watch Pins" Pin 0 0 1 0 1 1 1 1 "Displays a table of all watch pins (watched expressions, like those found in `Watch`, but instead of being within a table, being pinned to some source code location, like breakpoints). This table contains each pin's name, location, and controls for editing or deleting each pin." } + { ExceptionFilters "exception_filters" "Exception Filters" Gear 0 0 1 0 1 0 1 1 "An interface which controls whether or not the debugger will halt attached processes upon encountering specific exception codes for the first time." } + { Settings "settings" "Settings" Gear 0 0 1 0 1 0 1 1 "An interface to modify general settings for the debugger's appearance and behavior." } } @enum DF_GfxViewKind: @@ -260,7 +260,7 @@ DF_GfxViewTable: @data(DF_ViewSpecInfo) df_g_gfx_view_kind_spec_info_table: { - @expand(DF_GfxViewTable a) ```{(0|$(a.parameterized_by_entity)*DF_ViewSpecFlag_ParameterizedByEntity|$(a.project_specific)*DF_ViewSpecFlag_ProjectSpecific|$(a.can_serialize)*DF_ViewSpecFlag_CanSerialize|$(a.can_serialize_entity_path)*DF_ViewSpecFlag_CanSerializeEntityPath|$(a.can_filter)*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|$(a.filter_is_code)*DF_ViewSpecFlag_FilterIsCode|$(a.typing_automatically_filters)*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("$(a.name_lower)"), str8_lit_comp("$(a.display_string)"), DF_NameKind_$(a.name_kind), DF_IconKind_$(a.icon), DF_VIEW_SETUP_FUNCTION_NAME($(a.name)), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME($(a.name)), DF_VIEW_CMD_FUNCTION_NAME($(a.name)), DF_VIEW_UI_FUNCTION_NAME($(a.name))}```; + @expand(DF_GfxViewTable a) ```{(0|$(a.parameterized_by_entity)*DF_ViewSpecFlag_ParameterizedByEntity|$(a.project_specific)*DF_ViewSpecFlag_ProjectSpecific|$(a.can_serialize)*DF_ViewSpecFlag_CanSerialize|$(a.can_serialize_file_path)*DF_ViewSpecFlag_CanSerializeFilePath|$(a.can_filter)*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|$(a.filter_is_code)*DF_ViewSpecFlag_FilterIsCode|$(a.typing_automatically_filters)*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("$(a.name_lower)"), str8_lit_comp("$(a.display_string)"), DF_IconKind_$(a.icon), DF_VIEW_SETUP_FUNCTION_NAME($(a.name)), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME($(a.name)), DF_VIEW_CMD_FUNCTION_NAME($(a.name)), DF_VIEW_UI_FUNCTION_NAME($(a.name))}```; } //////////////////////////////// @@ -341,7 +341,7 @@ DF_GfxViewRuleTable: @data(DF_ViewSpecInfo) @c_file df_g_gfx_view_rule_tab_view_spec_info_table: { @expand(DF_GfxViewRuleTable a) - ```$(a.tu == "x" -> '{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("' .. a.string .. '_view_rule"), str8_lit_comp("' .. a.tab_display_string .. '"), DF_NameKind_Null, DF_IconKind_Binoculars, ' .. 'DF_VIEW_SETUP_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_CMD_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_UI_FUNCTION_NAME(' .. a.string .. ') }')```; + ```$(a.tu == "x" -> '{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("' .. a.string .. '_view_rule"), str8_lit_comp("' .. a.tab_display_string .. '"), DF_IconKind_Binoculars, ' .. 'DF_VIEW_SETUP_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_CMD_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_UI_FUNCTION_NAME(' .. a.string .. ') }')```; } @data(DF_GfxViewRuleSpecInfo) @c_file df_g_gfx_view_rule_spec_info_table: diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 7a2bb90e..a143853e 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -591,13 +591,15 @@ df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view, // rjf: find visible breakpoints for source code ProfScope("find visible breakpoints") { - DF_Entity *file = df_entity_from_handle(df_interact_regs()->file); - for(DF_Entity *bp = file->first; !df_entity_is_nil(bp); bp = bp->next) + DF_EntityList bps = df_query_cached_entity_list_with_kind(DF_EntityKind_Breakpoint); + for(DF_EntityNode *n = bps.first; n != 0; n = n->next) { - if(bp->deleted || bp->kind != DF_EntityKind_Breakpoint) { continue; } - if(visible_line_num_range.min <= bp->text_point.line && bp->text_point.line <= visible_line_num_range.max) + DF_Entity *bp = n->entity; + DF_Entity *loc = df_entity_child_from_kind(bp, DF_EntityKind_Location); + if(path_match_normalized(loc->name, df_interact_regs()->file_path) && + visible_line_num_range.min <= loc->text_point.line && loc->text_point.line <= visible_line_num_range.max) { - U64 slice_line_idx = (bp->text_point.line-visible_line_num_range.min); + U64 slice_line_idx = (loc->text_point.line-visible_line_num_range.min); df_entity_list_push(scratch.arena, &code_slice_params.line_bps[slice_line_idx], bp); } } @@ -606,7 +608,7 @@ df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view, // rjf: find live threads mapping to source code ProfScope("find live threads mapping to this file") { - DF_Entity *file = df_entity_from_handle(df_interact_regs()->file); + String8 file_path = df_interact_regs()->file_path; DF_Entity *selected_thread = df_entity_from_handle(df_interact_regs()->thread); DF_EntityList threads = df_query_cached_entity_list_with_kind(DF_EntityKind_Thread); for(DF_EntityNode *thread_n = threads.first; thread_n != 0; thread_n = thread_n->next) @@ -623,7 +625,7 @@ df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view, DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, rip_voff); for(DF_LineNode *n = lines.first; n != 0; n = n->next) { - if(df_entity_from_handle(n->v.file) == file && visible_line_num_range.min <= n->v.pt.line && n->v.pt.line <= visible_line_num_range.max) + if(path_match_normalized(n->v.file_path, file_path) && visible_line_num_range.min <= n->v.pt.line && n->v.pt.line <= visible_line_num_range.max) { U64 slice_line_idx = n->v.pt.line-visible_line_num_range.min; df_entity_list_push(scratch.arena, &code_slice_params.line_ips[slice_line_idx], thread); @@ -635,13 +637,15 @@ df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view, // rjf: find visible watch pins for source code ProfScope("find visible watch pins") { - DF_Entity *file = df_entity_from_handle(df_interact_regs()->file); - for(DF_Entity *wp = file->first; !df_entity_is_nil(wp); wp = wp->next) + DF_EntityList wps = df_query_cached_entity_list_with_kind(DF_EntityKind_WatchPin); + for(DF_EntityNode *n = wps.first; n != 0; n = n->next) { - if(wp->deleted || wp->kind != DF_EntityKind_WatchPin) { continue; } - if(visible_line_num_range.min <= wp->text_point.line && wp->text_point.line <= visible_line_num_range.max) + DF_Entity *wp = n->entity; + DF_Entity *loc = df_entity_child_from_kind(wp, DF_EntityKind_Location); + if(path_match_normalized(loc->name, df_interact_regs()->file_path) && + visible_line_num_range.min <= loc->text_point.line && loc->text_point.line <= visible_line_num_range.max) { - U64 slice_line_idx = (wp->text_point.line-visible_line_num_range.min); + U64 slice_line_idx = (loc->text_point.line-visible_line_num_range.min); df_entity_list_push(scratch.arena, &code_slice_params.line_pins[slice_line_idx], wp); } } @@ -650,8 +654,8 @@ df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view, // rjf: find all src -> dasm info ProfScope("find all src -> dasm info") { - DF_Entity *file = df_entity_from_handle(df_interact_regs()->file); - DF_LineListArray lines_array = df_lines_array_from_file_line_range(scratch.arena, file, visible_line_num_range); + String8 file_path = df_interact_regs()->file_path; + DF_LineListArray lines_array = df_lines_array_from_file_path_line_range(scratch.arena, file_path, visible_line_num_range); if(lines_array.count != 0) { MemoryCopy(code_slice_params.line_infos, lines_array.v, sizeof(DF_LineList)*lines_array.count); @@ -1856,7 +1860,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS p.vaddr = vaddr; if(lines.first != 0) { - p.file_path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(lines.first->v.file)); + p.file_path = lines.first->v.file_path; p.text_point = lines.first->v.pt; } df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); @@ -2705,7 +2709,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS p.vaddr = vaddr; if(lines.first != 0) { - p.file_path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(lines.first->v.file)); + p.file_path = lines.first->v.file_path; p.text_point = lines.first->v.pt; } df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation)); @@ -3347,7 +3351,7 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem) if(query_normalized_with_opt_slash_props.flags & FilePropertyFlag_IsFolder) { String8 new_path = push_str8f(scratch.arena, "%S%S/", path_query.path, path_query.search); - df_view_equip_spec(ws, view, view->spec, df_entity_from_handle(view->entity), new_path, &df_g_nil_cfg_node); + df_view_equip_spec(ws, view, view->spec, &df_g_nil_entity, str8_zero(), new_path, &df_g_nil_cfg_node); } // rjf: is a file -> complete view @@ -3377,7 +3381,7 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem) { String8 existing_path = str8_chop_last_slash(path_query.path); String8 new_path = push_str8f(scratch.arena, "%S/%S/", existing_path, files[0].filename); - df_view_equip_spec(ws, view, view->spec, df_entity_from_handle(view->entity), new_path, &df_g_nil_cfg_node); + df_view_equip_spec(ws, view, view->spec, &df_g_nil_entity, str8_zero(), new_path, &df_g_nil_cfg_node); } else { @@ -3507,7 +3511,7 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem) String8 new_path = str8_chop_last_slash(str8_chop_last_slash(path_query.path)); new_path = path_normalized_from_string(scratch.arena, new_path); String8 new_cmd = push_str8f(scratch.arena, "%S%s", new_path, new_path.size != 0 ? "/" : ""); - df_view_equip_spec(ws, view, view->spec, df_entity_from_handle(view->entity), new_cmd, &df_g_nil_cfg_node); + df_view_equip_spec(ws, view, view->spec, &df_g_nil_entity, str8_zero(), new_cmd, &df_g_nil_cfg_node); } } @@ -3589,7 +3593,7 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem) if(file->props.flags & FilePropertyFlag_IsFolder) { String8 new_cmd = push_str8f(scratch.arena, "%S%s", new_path, new_path.size != 0 ? "/" : ""); - df_view_equip_spec(ws, view, view->spec, df_entity_from_handle(view->entity), new_cmd, &df_g_nil_cfg_node); + df_view_equip_spec(ws, view, view->spec, &df_g_nil_entity, str8_zero(), new_cmd, &df_g_nil_cfg_node); } else { @@ -4113,7 +4117,7 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister) DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, binary_voff); if(lines.first != 0) { - String8 file_path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(lines.first->v.file)); + String8 file_path = lines.first->v.file_path; S64 line_num = lines.first->v.pt.line; DF_Font(ws, DF_FontSlot_Main) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("%S:%I64d", file_path, line_num); @@ -4150,7 +4154,7 @@ DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Target) DF_VIEW_CMD_FUNCTION_DEF(Target) { DF_TargetViewState *tv = df_view_user_state(view, DF_TargetViewState); - DF_Entity *entity = df_entity_from_handle(view->entity); + DF_Entity *entity = df_entity_from_handle(view->params_entity); // rjf: process commands for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) @@ -4193,7 +4197,7 @@ DF_VIEW_UI_FUNCTION_DEF(Target) { ProfBeginFunction(); Temp scratch = scratch_begin(0, 0); - DF_Entity *entity = df_entity_from_handle(view->entity); + DF_Entity *entity = df_entity_from_handle(view->params_entity); DF_EntityList custom_entry_points = df_push_entity_child_list_with_kind(scratch.arena, entity, DF_EntityKind_EntryPointName); F32 row_height_px = floor_f32(ui_top_font_size()*2.5f); @@ -4565,12 +4569,12 @@ DF_VIEW_UI_FUNCTION_DEF(Targets) UI_PrefWidth(ui_em(2.25f, 1)) UI_FocusHot((row_selected && cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off) { - UI_Signal sig = df_icon_buttonf(ws, target->b32 ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, "###ebl_%p", target); + UI_Signal sig = df_icon_buttonf(ws, !target->disabled ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, "###ebl_%p", target); if(ui_clicked(sig)) { DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); p.entity = df_handle_from_entity(target); - df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(target->b32 ? DF_CoreCmdKind_DisableTarget : DF_CoreCmdKind_EnableTarget)); + df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(!target->disabled ? DF_CoreCmdKind_DisableTarget : DF_CoreCmdKind_EnableTarget)); } } @@ -5491,11 +5495,7 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler) DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, rip_voff); if(lines.first != 0) { - DF_Entity *file = df_entity_from_handle(lines.first->v.file); - if(!df_entity_is_nil(file)) - { - UI_PrefWidth(ui_children_sum(0)) df_entity_src_loc_button(ws, file, lines.first->v.pt); - } + UI_PrefWidth(ui_children_sum(0)) df_src_loc_button(ws, lines.first->v.file_path, lines.first->v.pt); } } }break; @@ -6165,25 +6165,25 @@ DF_VIEW_UI_FUNCTION_DEF(Modules) } //////////////////////////////// -//~ rjf: PendingEntity @view_hook_impl +//~ rjf: PendingFile @view_hook_impl -DF_VIEW_SETUP_FUNCTION_DEF(PendingEntity) +DF_VIEW_SETUP_FUNCTION_DEF(PendingFile) { - DF_PendingEntityViewState *pves = df_view_user_state(view, DF_PendingEntityViewState); + DF_PendingFileViewState *pves = df_view_user_state(view, DF_PendingFileViewState); pves->deferred_cmd_arena = df_view_push_arena_ext(view); pves->complete_cfg_arena = df_view_push_arena_ext(view); pves->complete_cfg_root = df_cfg_tree_copy(pves->complete_cfg_arena, cfg_root); } -DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(PendingEntity) +DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(PendingFile) { return str8_lit(""); } -DF_VIEW_CMD_FUNCTION_DEF(PendingEntity) +DF_VIEW_CMD_FUNCTION_DEF(PendingFile) { Temp scratch = scratch_begin(0, 0); - DF_PendingEntityViewState *pves = df_view_user_state(view, DF_PendingEntityViewState); + DF_PendingFileViewState *pves = df_view_user_state(view, DF_PendingFileViewState); //- rjf: process commands for(DF_CmdNode *n = cmds->first; n != 0; n = n->next) @@ -6214,22 +6214,13 @@ DF_VIEW_CMD_FUNCTION_DEF(PendingEntity) } } - //- rjf: determine if entity is ready, and which viewer to use - DF_Entity *entity = df_entity_from_handle(view->entity); - DF_GfxViewKind viewer_kind = DF_GfxViewKind_Null; - B32 entity_is_ready = 0; - switch(entity->kind) - { - default:{}break; - case DF_EntityKind_File: - { - entity_is_ready = 1; - viewer_kind = DF_GfxViewKind_Code; - }break; - } + //- rjf: determine if file is ready, and which viewer to use + String8 file_path = view->params_file_path; + B32 file_is_ready = 1; + DF_GfxViewKind viewer_kind = DF_GfxViewKind_Code; //- rjf: if entity is ready, dispatch all deferred commands - if(entity_is_ready) + if(file_is_ready) { for(DF_CmdNode *cmd_node = pves->deferred_cmds.first; cmd_node != 0; cmd_node = cmd_node->next) { @@ -6242,25 +6233,25 @@ DF_VIEW_CMD_FUNCTION_DEF(PendingEntity) //- rjf: if entity is ready, move cfg tree to scratch for new command DF_CfgNode *cfg_root = &df_g_nil_cfg_node; - if(entity_is_ready) + if(file_is_ready) { cfg_root = df_cfg_tree_copy(scratch.arena, pves->complete_cfg_root); } //- rjf: if entity is ready, replace this view with the correct one, if any viewer is specified - if(entity_is_ready && viewer_kind != DF_GfxViewKind_Null) + if(file_is_ready && viewer_kind != DF_GfxViewKind_Null) { DF_ViewSpec *view_spec = df_view_spec_from_string(cfg_root->string); if(view_spec == &df_g_nil_view_spec) { view_spec = df_view_spec_from_gfx_view_kind(viewer_kind); } - df_view_equip_spec(ws, view, view_spec, entity, str8_lit(""), cfg_root); + df_view_equip_spec(ws, view, view_spec, &df_g_nil_entity, file_path, str8_lit(""), cfg_root); df_panel_notify_mutation(ws, panel); } //- rjf: if entity is ready, but we have no viewer for it, then just close this tab - if(entity_is_ready && viewer_kind == DF_GfxViewKind_Null) + if(file_is_ready && viewer_kind == DF_GfxViewKind_Null) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_CloseTab)); @@ -6269,7 +6260,7 @@ DF_VIEW_CMD_FUNCTION_DEF(PendingEntity) scratch_end(scratch); } -DF_VIEW_UI_FUNCTION_DEF(PendingEntity) +DF_VIEW_UI_FUNCTION_DEF(PendingFile) { view->loading_t = view->loading_t_target = 1.f; df_gfx_request_frame(); @@ -6314,8 +6305,7 @@ DF_VIEW_CMD_FUNCTION_DEF(Code) Temp scratch = scratch_begin(0, 0); HS_Scope *hs_scope = hs_scope_open(); TXT_Scope *txt_scope = txt_scope_open(); - DF_Entity *entity = df_entity_from_handle(df_interact_regs()->file); - String8 path = df_full_path_from_entity(scratch.arena, entity); + String8 path = df_interact_regs()->file_path; df_interact_regs()->text_key = fs_key_from_path(path); df_interact_regs()->lang_kind = txt_lang_kind_from_extension(str8_skip_last_dot(path)); U128 hash = {0}; @@ -6342,20 +6332,23 @@ DF_VIEW_CMD_FUNCTION_DEF(Code) switch(core_cmd_kind) { default:{}break; + + // rjf: override file picking case DF_CoreCmdKind_PickFile: { - DF_Entity *missing_file = df_entity_from_handle(cv->pick_file_override_target); - String8 pick_string = cmd->params.file_path; - if(!df_entity_is_nil(missing_file) && pick_string.size != 0) + String8 src = view->params_file_path; + String8 dst = cmd->params.file_path; + if(src.size != 0 && dst.size != 0) { - DF_Entity *replacement = df_entity_from_path(pick_string, DF_EntityFromPathFlag_OpenAsNeeded|DF_EntityFromPathFlag_OpenMissing); - view->entity = df_handle_from_entity(replacement); + // rjf: record src -> dst mapping DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); - p.entity = df_handle_from_entity(missing_file); - p.file_path = pick_string; - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Entity); - df_cmd_params_mark_slot(&p, DF_CmdParamSlot_FilePath); + p.string = src; + p.file_path = dst; df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetFileReplacementPath)); + + // rjf: switch this view to viewing replacement file + arena_clear(view->params_arena); + view->params_file_path = push_str8_copy(view->params_arena, dst); } }break; } @@ -6383,32 +6376,30 @@ DF_VIEW_UI_FUNCTION_DEF(Code) ////////////////////////////// //- rjf: unpack entity info // - DF_Entity *entity = df_entity_from_handle(df_interact_regs()->file); - String8 path = df_full_path_from_entity(scratch.arena, entity); + String8 path = df_interact_regs()->file_path; df_interact_regs()->text_key = fs_key_from_path(path); df_interact_regs()->lang_kind = txt_lang_kind_from_extension(str8_skip_last_dot(path)); U128 hash = {0}; TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, df_interact_regs()->text_key, df_interact_regs()->lang_kind, &hash); String8 data = hs_data_from_hash(hs_scope, hash); - B32 entity_is_missing = !!(entity->flags & DF_EntityFlag_IsMissing); + B32 file_is_missing = (os_properties_from_file_path(path).modified == 0); B32 key_has_data = !u128_match(hash, u128_zero()) && info.lines_count; ////////////////////////////// //- rjf: build missing file interface // - if(entity_is_missing && !key_has_data) + if(file_is_missing && !key_has_data) { UI_WidthFill UI_HeightFill UI_Column UI_Padding(ui_pct(1, 0)) { Temp scratch = scratch_begin(0, 0); - String8 full_path = df_full_path_from_entity(scratch.arena, entity); UI_PrefWidth(ui_children_sum(1)) UI_PrefHeight(ui_em(3, 1)) UI_Row UI_Padding(ui_pct(1, 0)) UI_PrefWidth(ui_text_dim(10, 1)) UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) { DF_Font(ws, DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); - ui_labelf("Could not find \"%S\".", full_path); + ui_labelf("Could not find \"%S\".", path); } UI_PrefHeight(ui_em(3, 1)) UI_Row UI_Padding(ui_pct(1, 0)) @@ -6424,7 +6415,6 @@ DF_VIEW_UI_FUNCTION_DEF(Code) params.cmd_spec = df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_PickFile); df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_CmdSpec); df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunCommand)); - cv->pick_file_override_target = view->entity; } scratch_end(scratch); } @@ -6433,7 +6423,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) ////////////////////////////// //- rjf: code is not missing, but not ready -> equip loading info to this view // - if(!entity_is_missing && info.lines_count == 0) + if(!file_is_missing && info.lines_count == 0) { df_view_equip_loading_info(view, 1, info.bytes_processed, info.bytes_to_process); } @@ -6442,7 +6432,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) //- rjf: build code contents // DI_KeyList dbgi_keys = {0}; - if(!entity_is_missing && key_has_data) + if(!file_is_missing && key_has_data) { DF_CodeViewBuildResult result = df_code_view_build(scratch.arena, ws, panel, view, cv, DF_CodeViewBuildFlag_All, code_area_rect, data, &info, 0, r1u64(0, 0), di_key_zero()); dbgi_keys = result.dbgi_keys; @@ -6452,7 +6442,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) //- rjf: unpack cursor info // { - df_interact_regs()->lines = df_lines_from_file_line_num(df_frame_arena(), entity, df_interact_regs()->cursor.line); + df_interact_regs()->lines = df_lines_from_file_path_line_num(df_frame_arena(), path, df_interact_regs()->cursor.line); } ////////////////////////////// @@ -6477,7 +6467,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) ////////////////////////////// //- rjf: build bottom bar // - if(!entity_is_missing && key_has_data) + if(!file_is_missing && key_has_data) { ui_set_next_rect(shift_2f32(bottom_bar_rect, scale_2f32(rect.p0, -1.f))); ui_set_next_flags(UI_BoxFlag_DrawBackground); @@ -7914,9 +7904,9 @@ DF_VIEW_UI_FUNCTION_DEF(Breakpoints) { UI_TableCell UI_FocusHot((row_is_selected && cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off) { - if(ui_clicked(df_icon_buttonf(ws, entity->b32 ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, "###ebl_%p", entity))) + if(ui_clicked(df_icon_buttonf(ws, !entity->disabled ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, "###ebl_%p", entity))) { - df_entity_equip_b32(entity, !entity->b32); + df_entity_equip_disabled(entity, !entity->disabled); } } UI_TableCell UI_FocusHot((row_is_selected && cursor.x == 1) ? UI_FocusKind_On : UI_FocusKind_Off) diff --git a/src/df/gfx/df_views.h b/src/df/gfx/df_views.h index dd58a8b0..ca7e15a4 100644 --- a/src/df/gfx/df_views.h +++ b/src/df/gfx/df_views.h @@ -94,10 +94,10 @@ struct DF_CmdListerItemArray }; //////////////////////////////// -//~ rjf: PendingEntity @view_types +//~ rjf: PendingFile @view_types -typedef struct DF_PendingEntityViewState DF_PendingEntityViewState; -struct DF_PendingEntityViewState +typedef struct DF_PendingFileViewState DF_PendingFileViewState; +struct DF_PendingFileViewState { Arena *deferred_cmd_arena; DF_CmdList deferred_cmds; @@ -365,7 +365,6 @@ struct DF_CodeViewState B32 initialized; S64 preferred_column; B32 drifted_for_search; - DF_Handle pick_file_override_target; DF_CodeViewFlags flags; // rjf: per-frame command info diff --git a/src/df/gfx/generated/df_gfx.meta.c b/src/df/gfx/generated/df_gfx.meta.c index a4e27ae2..2bded322 100644 --- a/src/df/gfx/generated/df_gfx.meta.c +++ b/src/df/gfx/generated/df_gfx.meta.c @@ -138,37 +138,37 @@ str8_lit_comp("open_project"), DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[31] = { -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("null"), str8_lit_comp(""), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(Null), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Null), DF_VIEW_CMD_FUNCTION_NAME(Null), DF_VIEW_UI_FUNCTION_NAME(Null)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("empty"), str8_lit_comp(""), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(Empty), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Empty), DF_VIEW_CMD_FUNCTION_NAME(Empty), DF_VIEW_UI_FUNCTION_NAME(Empty)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("getting_started"), str8_lit_comp("Getting Started"), DF_NameKind_Null, DF_IconKind_QuestionMark, DF_VIEW_SETUP_FUNCTION_NAME(GettingStarted), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(GettingStarted), DF_VIEW_CMD_FUNCTION_NAME(GettingStarted), DF_VIEW_UI_FUNCTION_NAME(GettingStarted)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("commands"), str8_lit_comp("Commands"), DF_NameKind_Null, DF_IconKind_List, DF_VIEW_SETUP_FUNCTION_NAME(Commands), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Commands), DF_VIEW_CMD_FUNCTION_NAME(Commands), DF_VIEW_UI_FUNCTION_NAME(Commands)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("file_system"), str8_lit_comp("File System"), DF_NameKind_Null, DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(FileSystem), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(FileSystem), DF_VIEW_CMD_FUNCTION_NAME(FileSystem), DF_VIEW_UI_FUNCTION_NAME(FileSystem)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("system_processes"), str8_lit_comp("System Processes"), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(SystemProcesses), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(SystemProcesses), DF_VIEW_CMD_FUNCTION_NAME(SystemProcesses), DF_VIEW_UI_FUNCTION_NAME(SystemProcesses)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("entity_lister"), str8_lit_comp("Entity List"), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(EntityLister), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(EntityLister), DF_VIEW_CMD_FUNCTION_NAME(EntityLister), DF_VIEW_UI_FUNCTION_NAME(EntityLister)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("symbol_lister"), str8_lit_comp("Symbols"), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(SymbolLister), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(SymbolLister), DF_VIEW_CMD_FUNCTION_NAME(SymbolLister), DF_VIEW_UI_FUNCTION_NAME(SymbolLister)}, -{(0|1*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("target"), str8_lit_comp("Target"), DF_NameKind_EntityName, DF_IconKind_Target, DF_VIEW_SETUP_FUNCTION_NAME(Target), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Target), DF_VIEW_CMD_FUNCTION_NAME(Target), DF_VIEW_UI_FUNCTION_NAME(Target)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("targets"), str8_lit_comp("Targets"), DF_NameKind_Null, DF_IconKind_Target, DF_VIEW_SETUP_FUNCTION_NAME(Targets), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Targets), DF_VIEW_CMD_FUNCTION_NAME(Targets), DF_VIEW_UI_FUNCTION_NAME(Targets)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("file_path_map"), str8_lit_comp("File Path Map"), DF_NameKind_Null, DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(FilePathMap), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(FilePathMap), DF_VIEW_CMD_FUNCTION_NAME(FilePathMap), DF_VIEW_UI_FUNCTION_NAME(FilePathMap)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("auto_view_rules"), str8_lit_comp("Auto View Rules"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(AutoViewRules), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(AutoViewRules), DF_VIEW_CMD_FUNCTION_NAME(AutoViewRules), DF_VIEW_UI_FUNCTION_NAME(AutoViewRules)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("scheduler"), str8_lit_comp("Scheduler"), DF_NameKind_Null, DF_IconKind_Scheduler, DF_VIEW_SETUP_FUNCTION_NAME(Scheduler), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Scheduler), DF_VIEW_CMD_FUNCTION_NAME(Scheduler), DF_VIEW_UI_FUNCTION_NAME(Scheduler)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("call_stack"), str8_lit_comp("Call Stack"), DF_NameKind_Null, DF_IconKind_Thread, DF_VIEW_SETUP_FUNCTION_NAME(CallStack), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(CallStack), DF_VIEW_CMD_FUNCTION_NAME(CallStack), DF_VIEW_UI_FUNCTION_NAME(CallStack)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("modules"), str8_lit_comp("Modules"), DF_NameKind_Null, DF_IconKind_Module, DF_VIEW_SETUP_FUNCTION_NAME(Modules), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Modules), DF_VIEW_CMD_FUNCTION_NAME(Modules), DF_VIEW_UI_FUNCTION_NAME(Modules)}, -{(0|1*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("pending_entity"), str8_lit_comp("Pending Entity"), DF_NameKind_EntityName, DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(PendingEntity), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(PendingEntity), DF_VIEW_CMD_FUNCTION_NAME(PendingEntity), DF_VIEW_UI_FUNCTION_NAME(PendingEntity)}, -{(0|1*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|1*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("code"), str8_lit_comp("Code"), DF_NameKind_EntityName, DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(Code), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Code), DF_VIEW_CMD_FUNCTION_NAME(Code), DF_VIEW_UI_FUNCTION_NAME(Code)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("disassembly"), str8_lit_comp("Disassembly"), DF_NameKind_Null, DF_IconKind_Glasses, DF_VIEW_SETUP_FUNCTION_NAME(Disassembly), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Disassembly), DF_VIEW_CMD_FUNCTION_NAME(Disassembly), DF_VIEW_UI_FUNCTION_NAME(Disassembly)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("watch"), str8_lit_comp("Watch"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Watch), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Watch), DF_VIEW_CMD_FUNCTION_NAME(Watch), DF_VIEW_UI_FUNCTION_NAME(Watch)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("locals"), str8_lit_comp("Locals"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Locals), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Locals), DF_VIEW_CMD_FUNCTION_NAME(Locals), DF_VIEW_UI_FUNCTION_NAME(Locals)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("registers"), str8_lit_comp("Registers"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Registers), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Registers), DF_VIEW_CMD_FUNCTION_NAME(Registers), DF_VIEW_UI_FUNCTION_NAME(Registers)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("globals"), str8_lit_comp("Globals"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Globals), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Globals), DF_VIEW_CMD_FUNCTION_NAME(Globals), DF_VIEW_UI_FUNCTION_NAME(Globals)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("thread_locals"), str8_lit_comp("Thread Locals"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(ThreadLocals), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(ThreadLocals), DF_VIEW_CMD_FUNCTION_NAME(ThreadLocals), DF_VIEW_UI_FUNCTION_NAME(ThreadLocals)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("types"), str8_lit_comp("Types"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Types), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Types), DF_VIEW_CMD_FUNCTION_NAME(Types), DF_VIEW_UI_FUNCTION_NAME(Types)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("procedures"), str8_lit_comp("Procedures"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Procedures), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Procedures), DF_VIEW_CMD_FUNCTION_NAME(Procedures), DF_VIEW_UI_FUNCTION_NAME(Procedures)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("output"), str8_lit_comp("Output"), DF_NameKind_Null, DF_IconKind_List, DF_VIEW_SETUP_FUNCTION_NAME(Output), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Output), DF_VIEW_CMD_FUNCTION_NAME(Output), DF_VIEW_UI_FUNCTION_NAME(Output)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("memory"), str8_lit_comp("Memory"), DF_NameKind_Null, DF_IconKind_Grid, DF_VIEW_SETUP_FUNCTION_NAME(Memory), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Memory), DF_VIEW_CMD_FUNCTION_NAME(Memory), DF_VIEW_UI_FUNCTION_NAME(Memory)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("breakpoints"), str8_lit_comp("Breakpoints"), DF_NameKind_Null, DF_IconKind_CircleFilled, DF_VIEW_SETUP_FUNCTION_NAME(Breakpoints), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Breakpoints), DF_VIEW_CMD_FUNCTION_NAME(Breakpoints), DF_VIEW_UI_FUNCTION_NAME(Breakpoints)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("watch_pins"), str8_lit_comp("Watch Pins"), DF_NameKind_Null, DF_IconKind_Pin, DF_VIEW_SETUP_FUNCTION_NAME(WatchPins), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(WatchPins), DF_VIEW_CMD_FUNCTION_NAME(WatchPins), DF_VIEW_UI_FUNCTION_NAME(WatchPins)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("exception_filters"), str8_lit_comp("Exception Filters"), DF_NameKind_Null, DF_IconKind_Gear, DF_VIEW_SETUP_FUNCTION_NAME(ExceptionFilters), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(ExceptionFilters), DF_VIEW_CMD_FUNCTION_NAME(ExceptionFilters), DF_VIEW_UI_FUNCTION_NAME(ExceptionFilters)}, -{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("settings"), str8_lit_comp("Settings"), DF_NameKind_Null, DF_IconKind_Gear, DF_VIEW_SETUP_FUNCTION_NAME(Settings), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Settings), DF_VIEW_CMD_FUNCTION_NAME(Settings), DF_VIEW_UI_FUNCTION_NAME(Settings)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("null"), str8_lit_comp(""), DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(Null), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Null), DF_VIEW_CMD_FUNCTION_NAME(Null), DF_VIEW_UI_FUNCTION_NAME(Null)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("empty"), str8_lit_comp(""), DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(Empty), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Empty), DF_VIEW_CMD_FUNCTION_NAME(Empty), DF_VIEW_UI_FUNCTION_NAME(Empty)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("getting_started"), str8_lit_comp("Getting Started"), DF_IconKind_QuestionMark, DF_VIEW_SETUP_FUNCTION_NAME(GettingStarted), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(GettingStarted), DF_VIEW_CMD_FUNCTION_NAME(GettingStarted), DF_VIEW_UI_FUNCTION_NAME(GettingStarted)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("commands"), str8_lit_comp("Commands"), DF_IconKind_List, DF_VIEW_SETUP_FUNCTION_NAME(Commands), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Commands), DF_VIEW_CMD_FUNCTION_NAME(Commands), DF_VIEW_UI_FUNCTION_NAME(Commands)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("file_system"), str8_lit_comp("File System"), DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(FileSystem), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(FileSystem), DF_VIEW_CMD_FUNCTION_NAME(FileSystem), DF_VIEW_UI_FUNCTION_NAME(FileSystem)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("system_processes"), str8_lit_comp("System Processes"), DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(SystemProcesses), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(SystemProcesses), DF_VIEW_CMD_FUNCTION_NAME(SystemProcesses), DF_VIEW_UI_FUNCTION_NAME(SystemProcesses)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("entity_lister"), str8_lit_comp("Entity List"), DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(EntityLister), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(EntityLister), DF_VIEW_CMD_FUNCTION_NAME(EntityLister), DF_VIEW_UI_FUNCTION_NAME(EntityLister)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("symbol_lister"), str8_lit_comp("Symbols"), DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(SymbolLister), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(SymbolLister), DF_VIEW_CMD_FUNCTION_NAME(SymbolLister), DF_VIEW_UI_FUNCTION_NAME(SymbolLister)}, +{(0|1*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("target"), str8_lit_comp("Target"), DF_IconKind_Target, DF_VIEW_SETUP_FUNCTION_NAME(Target), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Target), DF_VIEW_CMD_FUNCTION_NAME(Target), DF_VIEW_UI_FUNCTION_NAME(Target)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("targets"), str8_lit_comp("Targets"), DF_IconKind_Target, DF_VIEW_SETUP_FUNCTION_NAME(Targets), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Targets), DF_VIEW_CMD_FUNCTION_NAME(Targets), DF_VIEW_UI_FUNCTION_NAME(Targets)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("file_path_map"), str8_lit_comp("File Path Map"), DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(FilePathMap), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(FilePathMap), DF_VIEW_CMD_FUNCTION_NAME(FilePathMap), DF_VIEW_UI_FUNCTION_NAME(FilePathMap)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("auto_view_rules"), str8_lit_comp("Auto View Rules"), DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(AutoViewRules), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(AutoViewRules), DF_VIEW_CMD_FUNCTION_NAME(AutoViewRules), DF_VIEW_UI_FUNCTION_NAME(AutoViewRules)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("scheduler"), str8_lit_comp("Scheduler"), DF_IconKind_Scheduler, DF_VIEW_SETUP_FUNCTION_NAME(Scheduler), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Scheduler), DF_VIEW_CMD_FUNCTION_NAME(Scheduler), DF_VIEW_UI_FUNCTION_NAME(Scheduler)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("call_stack"), str8_lit_comp("Call Stack"), DF_IconKind_Thread, DF_VIEW_SETUP_FUNCTION_NAME(CallStack), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(CallStack), DF_VIEW_CMD_FUNCTION_NAME(CallStack), DF_VIEW_UI_FUNCTION_NAME(CallStack)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("modules"), str8_lit_comp("Modules"), DF_IconKind_Module, DF_VIEW_SETUP_FUNCTION_NAME(Modules), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Modules), DF_VIEW_CMD_FUNCTION_NAME(Modules), DF_VIEW_UI_FUNCTION_NAME(Modules)}, +{(0|1*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("pending_file"), str8_lit_comp("Pending File"), DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(PendingFile), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(PendingFile), DF_VIEW_CMD_FUNCTION_NAME(PendingFile), DF_VIEW_UI_FUNCTION_NAME(PendingFile)}, +{(0|1*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|1*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("code"), str8_lit_comp("Code"), DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(Code), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Code), DF_VIEW_CMD_FUNCTION_NAME(Code), DF_VIEW_UI_FUNCTION_NAME(Code)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("disassembly"), str8_lit_comp("Disassembly"), DF_IconKind_Glasses, DF_VIEW_SETUP_FUNCTION_NAME(Disassembly), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Disassembly), DF_VIEW_CMD_FUNCTION_NAME(Disassembly), DF_VIEW_UI_FUNCTION_NAME(Disassembly)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("watch"), str8_lit_comp("Watch"), DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Watch), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Watch), DF_VIEW_CMD_FUNCTION_NAME(Watch), DF_VIEW_UI_FUNCTION_NAME(Watch)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("locals"), str8_lit_comp("Locals"), DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Locals), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Locals), DF_VIEW_CMD_FUNCTION_NAME(Locals), DF_VIEW_UI_FUNCTION_NAME(Locals)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("registers"), str8_lit_comp("Registers"), DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Registers), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Registers), DF_VIEW_CMD_FUNCTION_NAME(Registers), DF_VIEW_UI_FUNCTION_NAME(Registers)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("globals"), str8_lit_comp("Globals"), DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Globals), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Globals), DF_VIEW_CMD_FUNCTION_NAME(Globals), DF_VIEW_UI_FUNCTION_NAME(Globals)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("thread_locals"), str8_lit_comp("Thread Locals"), DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(ThreadLocals), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(ThreadLocals), DF_VIEW_CMD_FUNCTION_NAME(ThreadLocals), DF_VIEW_UI_FUNCTION_NAME(ThreadLocals)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("types"), str8_lit_comp("Types"), DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Types), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Types), DF_VIEW_CMD_FUNCTION_NAME(Types), DF_VIEW_UI_FUNCTION_NAME(Types)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("procedures"), str8_lit_comp("Procedures"), DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Procedures), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Procedures), DF_VIEW_CMD_FUNCTION_NAME(Procedures), DF_VIEW_UI_FUNCTION_NAME(Procedures)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("output"), str8_lit_comp("Output"), DF_IconKind_List, DF_VIEW_SETUP_FUNCTION_NAME(Output), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Output), DF_VIEW_CMD_FUNCTION_NAME(Output), DF_VIEW_UI_FUNCTION_NAME(Output)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|0*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("memory"), str8_lit_comp("Memory"), DF_IconKind_Grid, DF_VIEW_SETUP_FUNCTION_NAME(Memory), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Memory), DF_VIEW_CMD_FUNCTION_NAME(Memory), DF_VIEW_UI_FUNCTION_NAME(Memory)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("breakpoints"), str8_lit_comp("Breakpoints"), DF_IconKind_CircleFilled, DF_VIEW_SETUP_FUNCTION_NAME(Breakpoints), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Breakpoints), DF_VIEW_CMD_FUNCTION_NAME(Breakpoints), DF_VIEW_UI_FUNCTION_NAME(Breakpoints)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("watch_pins"), str8_lit_comp("Watch Pins"), DF_IconKind_Pin, DF_VIEW_SETUP_FUNCTION_NAME(WatchPins), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(WatchPins), DF_VIEW_CMD_FUNCTION_NAME(WatchPins), DF_VIEW_UI_FUNCTION_NAME(WatchPins)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("exception_filters"), str8_lit_comp("Exception Filters"), DF_IconKind_Gear, DF_VIEW_SETUP_FUNCTION_NAME(ExceptionFilters), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(ExceptionFilters), DF_VIEW_CMD_FUNCTION_NAME(ExceptionFilters), DF_VIEW_UI_FUNCTION_NAME(ExceptionFilters)}, +{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_ProjectSpecific|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeFilePath|1*(DF_ViewSpecFlag_CanFilter|DF_ViewSpecFlag_CanSerializeQuery)|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("settings"), str8_lit_comp("Settings"), DF_IconKind_Gear, DF_VIEW_SETUP_FUNCTION_NAME(Settings), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Settings), DF_VIEW_CMD_FUNCTION_NAME(Settings), DF_VIEW_UI_FUNCTION_NAME(Settings)}, }; DF_CmdParamSlot df_g_cmd_param_slot_2_view_spec_src_map[7] = @@ -206,10 +206,10 @@ str8_lit_comp("function_breakpoint"), DF_ViewSpecInfo df_g_gfx_view_rule_tab_view_spec_info_table[4] = { -{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("text_view_rule"), str8_lit_comp("Text"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(text), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(text), DF_VIEW_CMD_FUNCTION_NAME(text), DF_VIEW_UI_FUNCTION_NAME(text) }, -{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("disasm_view_rule"), str8_lit_comp("Disassembly"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(disasm), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(disasm), DF_VIEW_CMD_FUNCTION_NAME(disasm), DF_VIEW_UI_FUNCTION_NAME(disasm) }, -{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("bitmap_view_rule"), str8_lit_comp("Bitmap"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(bitmap), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(bitmap), DF_VIEW_CMD_FUNCTION_NAME(bitmap), DF_VIEW_UI_FUNCTION_NAME(bitmap) }, -{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("geo_view_rule"), str8_lit_comp("Geometry"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(geo), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(geo), DF_VIEW_CMD_FUNCTION_NAME(geo), DF_VIEW_UI_FUNCTION_NAME(geo) }, +{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("text_view_rule"), str8_lit_comp("Text"), DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(text), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(text), DF_VIEW_CMD_FUNCTION_NAME(text), DF_VIEW_UI_FUNCTION_NAME(text) }, +{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("disasm_view_rule"), str8_lit_comp("Disassembly"), DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(disasm), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(disasm), DF_VIEW_CMD_FUNCTION_NAME(disasm), DF_VIEW_UI_FUNCTION_NAME(disasm) }, +{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("bitmap_view_rule"), str8_lit_comp("Bitmap"), DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(bitmap), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(bitmap), DF_VIEW_CMD_FUNCTION_NAME(bitmap), DF_VIEW_UI_FUNCTION_NAME(bitmap) }, +{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("geo_view_rule"), str8_lit_comp("Geometry"), DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(geo), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(geo), DF_VIEW_CMD_FUNCTION_NAME(geo), DF_VIEW_UI_FUNCTION_NAME(geo) }, }; DF_GfxViewRuleSpecInfo df_g_gfx_view_rule_spec_info_table[14] = diff --git a/src/df/gfx/generated/df_gfx.meta.h b/src/df/gfx/generated/df_gfx.meta.h index 3be5c957..4dc2fd83 100644 --- a/src/df/gfx/generated/df_gfx.meta.h +++ b/src/df/gfx/generated/df_gfx.meta.h @@ -23,7 +23,7 @@ DF_GfxViewKind_AutoViewRules, DF_GfxViewKind_Scheduler, DF_GfxViewKind_CallStack, DF_GfxViewKind_Modules, -DF_GfxViewKind_PendingEntity, +DF_GfxViewKind_PendingFile, DF_GfxViewKind_Code, DF_GfxViewKind_Disassembly, DF_GfxViewKind_Watch, @@ -175,7 +175,7 @@ DF_VIEW_SETUP_FUNCTION_DEF(AutoViewRules); DF_VIEW_SETUP_FUNCTION_DEF(Scheduler); DF_VIEW_SETUP_FUNCTION_DEF(CallStack); DF_VIEW_SETUP_FUNCTION_DEF(Modules); -DF_VIEW_SETUP_FUNCTION_DEF(PendingEntity); +DF_VIEW_SETUP_FUNCTION_DEF(PendingFile); DF_VIEW_SETUP_FUNCTION_DEF(Code); DF_VIEW_SETUP_FUNCTION_DEF(Disassembly); DF_VIEW_SETUP_FUNCTION_DEF(Watch); @@ -206,7 +206,7 @@ DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(AutoViewRules); DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Scheduler); DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(CallStack); DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Modules); -DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(PendingEntity); +DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(PendingFile); DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Code); DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Disassembly); DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Watch); @@ -237,7 +237,7 @@ DF_VIEW_CMD_FUNCTION_DEF(AutoViewRules); DF_VIEW_CMD_FUNCTION_DEF(Scheduler); DF_VIEW_CMD_FUNCTION_DEF(CallStack); DF_VIEW_CMD_FUNCTION_DEF(Modules); -DF_VIEW_CMD_FUNCTION_DEF(PendingEntity); +DF_VIEW_CMD_FUNCTION_DEF(PendingFile); DF_VIEW_CMD_FUNCTION_DEF(Code); DF_VIEW_CMD_FUNCTION_DEF(Disassembly); DF_VIEW_CMD_FUNCTION_DEF(Watch); @@ -268,7 +268,7 @@ DF_VIEW_UI_FUNCTION_DEF(AutoViewRules); DF_VIEW_UI_FUNCTION_DEF(Scheduler); DF_VIEW_UI_FUNCTION_DEF(CallStack); DF_VIEW_UI_FUNCTION_DEF(Modules); -DF_VIEW_UI_FUNCTION_DEF(PendingEntity); +DF_VIEW_UI_FUNCTION_DEF(PendingFile); DF_VIEW_UI_FUNCTION_DEF(Code); DF_VIEW_UI_FUNCTION_DEF(Disassembly); DF_VIEW_UI_FUNCTION_DEF(Watch); diff --git a/src/path/path.c b/src/path/path.c index 60df6685..b4817291 100644 --- a/src/path/path.c +++ b/src/path/path.c @@ -163,3 +163,16 @@ path_normalized_from_string(Arena *arena, String8 path_string){ return(result); } +internal B32 +path_match_normalized(String8 left, String8 right) +{ + B32 result = 0; + { + Temp scratch = scratch_begin(0, 0); + String8 left_normalized = path_normalized_from_string(scratch.arena, left); + String8 right_normalized = path_normalized_from_string(scratch.arena, right); + result = str8_match(left_normalized, right_normalized, StringMatchFlag_CaseInsensitive); + scratch_end(scratch); + } + return result; +} diff --git a/src/path/path.h b/src/path/path.h index 4bd4650d..dd110eb1 100644 --- a/src/path/path.h +++ b/src/path/path.h @@ -12,5 +12,6 @@ internal String8 path_relative_dst_from_absolute_dst_src(Arena *arena, String8 d internal String8 path_absolute_dst_from_relative_dst_src(Arena *arena, String8 dst, String8 src); internal String8List path_normalized_list_from_string(Arena *arena, String8 path, PathStyle *style_out); internal String8 path_normalized_from_string(Arena *arena, String8 path); +internal B32 path_match_normalized(String8 left, String8 right); #endif //PATH_H diff --git a/src/raddbg/raddbg_main.c b/src/raddbg/raddbg_main.c index a54463d7..86949792 100644 --- a/src/raddbg/raddbg_main.c +++ b/src/raddbg/raddbg_main.c @@ -246,7 +246,6 @@ entry_point(CmdLine *cmd_line) { Temp scratch = scratch_begin(0, 0); DF_Entity *target = df_entity_alloc(df_entity_root(), DF_EntityKind_Target); - df_entity_equip_b32(target, 1); df_entity_equip_cfg_src(target, DF_CfgSrc_CommandLine); String8List passthrough_args_list = {0}; for(String8Node *n = args.first->next; n != 0; n = n->next)