display project names in recent project list; fix 0s for address-disabled string viz

This commit is contained in:
Ryan Fleury
2026-05-13 15:50:59 -07:00
parent fbe7b20aee
commit d207398934
7 changed files with 42 additions and 13 deletions
@@ -1845,9 +1845,8 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
//- rjf: step 0: do pre-prefix pointer value if requested //- rjf: step 0: do pre-prefix pointer value if requested
case 0: case 0:
{ {
if(!ptr_data->addr_is_good || if(!(params->flags & EV_StringFlag_DisableAddresses) &&
(!(params->flags & EV_StringFlag_DisableAddresses) && (!ptr_data->addr_is_good || params->flags & EV_StringFlag_AddressesBeforeContent))
params->flags & EV_StringFlag_AddressesBeforeContent))
{ {
Temp scratch = scratch_begin(&arena, 1); Temp scratch = scratch_begin(&arena, 1);
String8 ptr_value_string = str8_from_u64(scratch.arena, ptr_data->value_eval.value.u64, String8 ptr_value_string = str8_from_u64(scratch.arena, ptr_data->value_eval.value.u64,
@@ -1858,9 +1857,13 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
} }
*out_string = str8_copy(arena, ptr_value_string); *out_string = str8_copy(arena, ptr_value_string);
ptr_data->did_pre_prefix_ptr = 1; ptr_data->did_pre_prefix_ptr = 1;
need_pop = !ptr_data->addr_is_good;
scratch_end(scratch); scratch_end(scratch);
} }
need_pop = !ptr_data->addr_is_good; else
{
need_pop = 0;
}
}break; }break;
//- rjf: step 1 -> try "prefix content", which we want to print before the pointer value, //- rjf: step 1 -> try "prefix content", which we want to print before the pointer value,
+1 -1
View File
@@ -460,7 +460,7 @@ RD_NameSchemaInfo rd_name_schema_info_table[39] =
{str8_lit_comp("debug_info"), 0, str8_lit_comp("@row_commands(enable_cfg, duplicate_cfg, remove_cfg)\n@collection_commands(load_debug_info)\nx:\n{\n 'path': @no_relativize path,\n @query 'guid': string,\n @no_revert @no_expand @default(1) 'enabled': bool,\n}\n")}, {str8_lit_comp("debug_info"), 0, str8_lit_comp("@row_commands(enable_cfg, duplicate_cfg, remove_cfg)\n@collection_commands(load_debug_info)\nx:\n{\n 'path': @no_relativize path,\n @query 'guid': string,\n @no_revert @no_expand @default(1) 'enabled': bool,\n}\n")},
{str8_lit_comp("file_path_map"), 0, str8_lit_comp("@collection_commands(add_file_path_map) @row_commands(remove_cfg) x:{'source': @no_relativize path, 'dest': @no_relativize path}")}, {str8_lit_comp("file_path_map"), 0, str8_lit_comp("@collection_commands(add_file_path_map) @row_commands(remove_cfg) x:{'source': @no_relativize path, 'dest': @no_relativize path}")},
{str8_lit_comp("type_view"), 0, str8_lit_comp("@collection_commands(add_type_view) @row_commands(remove_cfg) x:{'type':expr_string, 'expr':expr_string}")}, {str8_lit_comp("type_view"), 0, str8_lit_comp("@collection_commands(add_type_view) @row_commands(remove_cfg) x:{'type':expr_string, 'expr':expr_string}")},
{str8_lit_comp("recent_project"), 0, str8_lit_comp("x:{'path':path}")}, {str8_lit_comp("recent_project"), 0, str8_lit_comp("x:{'path':path, 'name':string}")},
{str8_lit_comp("machine"), 0, str8_lit_comp("x:{'label':code_string, @no_expand 'active':bool, 'unattached_processes':set, 'processes':set}")}, {str8_lit_comp("machine"), 0, str8_lit_comp("x:{'label':code_string, @no_expand 'active':bool, 'unattached_processes':set, 'processes':set}")},
{str8_lit_comp("process"), 0, str8_lit_comp("x:{'label':code_string, 'id':u64, @no_expand 'active':bool, 'modules':set, 'threads':set}")}, {str8_lit_comp("process"), 0, str8_lit_comp("x:{'label':code_string, 'id':u64, @no_expand 'active':bool, 'modules':set, 'threads':set}")},
{str8_lit_comp("module"), 0, str8_lit_comp("x:{'exe':path, 'dbg':path, 'vaddr_range':vaddr_range}")}, {str8_lit_comp("module"), 0, str8_lit_comp("x:{'exe':path, 'dbg':path, 'vaddr_range':vaddr_range}")},
+1 -1
View File
@@ -779,7 +779,7 @@ RD_VocabTable:
//- rjf: @schema recent_project //- rjf: @schema recent_project
{ {
recent_project, 0, recent_project, 0,
```x:{'path':path}```, ```x:{'path':path, 'name':string}```,
} }
//- rjf: @schema machine //- rjf: @schema machine
+25
View File
@@ -227,6 +227,14 @@ rd_location_from_cfg(CFG_Node *cfg)
return dst_loc; return dst_loc;
} }
internal String8
rd_name_from_cfg(CFG_Node *cfg)
{
CFG_Node *name_root = cfg_node_child_from_string(cfg, str8_lit("name"));
String8 result = name_root->first->string;
return result;
}
internal String8 internal String8
rd_label_from_cfg(CFG_Node *cfg) rd_label_from_cfg(CFG_Node *cfg)
{ {
@@ -12688,6 +12696,16 @@ rd_frame(void)
} }
} }
} }
//- rjf: if just opened project -> set new current path
if(kind == RD_CmdKind_OpenProject)
{
String8 new_current_dir = str8_chop_last_slash(rd_regs()->file_path);
if(new_current_dir.size != 0)
{
rd_cmd(RD_CmdKind_SetCurrentPath, .file_path = new_current_dir);
}
}
}break; }break;
case RD_CmdKind_NewUser: case RD_CmdKind_NewUser:
{ {
@@ -12755,6 +12773,13 @@ rd_frame(void)
CFG_Node *path_root = cfg_node_new(rd_state->cfg, recent_project, str8_lit("path")); CFG_Node *path_root = cfg_node_new(rd_state->cfg, recent_project, str8_lit("path"));
cfg_node_new(rd_state->cfg, path_root, file_path); cfg_node_new(rd_state->cfg, path_root, file_path);
} }
{
CFG_Node *root = cfg_node_root();
CFG_Node *project = cfg_node_child_from_string(root, s("project"));
CFG_Node *name = cfg_node_child_from_string(project, s("name"));
CFG_Node *recent_project_name_root = cfg_node_child_from_string_or_alloc(rd_state->cfg, recent_project, s("name"));
cfg_node_new_replace(rd_state->cfg, recent_project_name_root, name->first->string);
}
cfg_node_unhook(rd_state->cfg, user, recent_project); cfg_node_unhook(rd_state->cfg, user, recent_project);
cfg_node_insert_child(rd_state->cfg, user, &cfg_nil_node, recent_project); cfg_node_insert_child(rd_state->cfg, user, &cfg_nil_node, recent_project);
recent_projects = cfg_node_child_list_from_string(scratch.arena, user, str8_lit("recent_project")); recent_projects = cfg_node_child_list_from_string(scratch.arena, user, str8_lit("recent_project"));
+1
View File
@@ -618,6 +618,7 @@ internal Vec4F32 rd_color_from_cfg(CFG_Node *cfg);
internal B32 rd_disabled_from_cfg(CFG_Node *cfg); internal B32 rd_disabled_from_cfg(CFG_Node *cfg);
internal RD_Location rd_location_from_cfg(CFG_Node *cfg); internal RD_Location rd_location_from_cfg(CFG_Node *cfg);
internal String8 rd_name_from_cfg(CFG_Node *cfg);
internal String8 rd_label_from_cfg(CFG_Node *cfg); internal String8 rd_label_from_cfg(CFG_Node *cfg);
internal String8 rd_expr_from_cfg(CFG_Node *cfg); internal String8 rd_expr_from_cfg(CFG_Node *cfg);
internal String8 rd_path_from_cfg(CFG_Node *cfg); internal String8 rd_path_from_cfg(CFG_Node *cfg);
+3 -4
View File
@@ -9,8 +9,6 @@
// [ ] memory_size(...) view for quickly evaluating memory sizes // [ ] memory_size(...) view for quickly evaluating memory sizes
// [ ] value coloring view in watch window, so you can quickly scroll & see values outside of a threshold // [ ] value coloring view in watch window, so you can quickly scroll & see values outside of a threshold
// //
// [ ] external window focusing bugs
//
// [ ] PDB -> RDI conversion memory usage // [ ] PDB -> RDI conversion memory usage
// [ ] more things should move to user data, but project-tagged - like // [ ] more things should move to user data, but project-tagged - like
// recent files, watches?, etc. // recent files, watches?, etc.
@@ -44,7 +42,7 @@
// //
//- jeff notes //- jeff notes
// [ ] focus changing on f10/f11? may be related to auto_run/auto_step - look at a bin/jeffr // [ ] focus changing on f10/f11? may be related to auto_run/auto_step - look at a bin/jeffr
// [ ] option to prefer addresses first with string ptrs // auto_step, launching terminal, terminal steals focus from debugger...
// //
//- urgent fixes //- urgent fixes
// [ ] (use msvc assert as an example) show fastfail exception info (code, name, etc.) - comes from ExceptionInformation @fastfail // [ ] (use msvc assert as an example) show fastfail exception info (code, name, etc.) - comes from ExceptionInformation @fastfail
@@ -59,7 +57,6 @@
// [ ] "skip breakpoint, run to source", when stopped at a non-source location // [ ] "skip breakpoint, run to source", when stopped at a non-source location
// [ ] adjust menu bar rendering when not focused // [ ] adjust menu bar rendering when not focused
// [ ] treat int 0x29 similarly to int3 // [ ] treat int 0x29 similarly to int3
// [ ] auto_step, launching terminal, terminal steals focus from debugger...
// //
//- memory view //- memory view
// [ ] have smaller visible range than entire memory space, within some bounds (e.g. 64KB) // [ ] have smaller visible range than entire memory space, within some bounds (e.g. 64KB)
@@ -269,6 +266,8 @@
// [x] eval space reads/writes -> needs staleness/badness info - replace ctrl layer, to apply to all spaces // [x] eval space reads/writes -> needs staleness/badness info - replace ctrl layer, to apply to all spaces
// [x] no selected thread -> causing evaluation failures, e.g. with go-to-definition // [x] no selected thread -> causing evaluation failures, e.g. with go-to-definition
// [x] single-line viz for pointers w/ bad (unmapped) addresses // [x] single-line viz for pointers w/ bad (unmapped) addresses
// [x] option to prefer addresses first with string ptrs
// [x] external window focusing bugs
//////////////////////////////// ////////////////////////////////
//~ rjf: Build Options //~ rjf: Build Options
+4 -3
View File
@@ -15,6 +15,7 @@ rd_title_fstrs_from_cfg(Arena *arena, CFG_Node *cfg, B32 include_extras)
B32 is_disabled = rd_disabled_from_cfg(cfg); B32 is_disabled = rd_disabled_from_cfg(cfg);
RD_Location loc = rd_location_from_cfg(cfg); RD_Location loc = rd_location_from_cfg(cfg);
D_Target target = rd_target_from_cfg(scratch.arena, cfg); D_Target target = rd_target_from_cfg(scratch.arena, cfg);
String8 name_string = rd_name_from_cfg(cfg);
String8 label_string = rd_label_from_cfg(cfg); String8 label_string = rd_label_from_cfg(cfg);
String8 expr_string = rd_expr_from_cfg(cfg); String8 expr_string = rd_expr_from_cfg(cfg);
String8 collection_name = {0}; String8 collection_name = {0};
@@ -163,10 +164,10 @@ rd_title_fstrs_from_cfg(Arena *arena, CFG_Node *cfg, B32 include_extras)
} }
} }
//- rjf: push label //- rjf: push name
if(label_string.size != 0) if(name_string.size != 0)
{ {
dr_fstrs_push_new(arena, &result, &params, label_string, .font = rd_font_from_slot(RD_FontSlot_Code), .raster_flags = rd_raster_flags_from_slot(RD_FontSlot_Code)); dr_fstrs_push_new(arena, &result, &params, name_string);
dr_fstrs_push_new(arena, &result, &params, str8_lit(" ")); dr_fstrs_push_new(arena, &result, &params, str8_lit(" "));
start_secondary(); start_secondary();
} }