diff --git a/src/eval_visualization/eval_visualization_core.c b/src/eval_visualization/eval_visualization_core.c index cb6a9217..d1109ace 100644 --- a/src/eval_visualization/eval_visualization_core.c +++ b/src/eval_visualization/eval_visualization_core.c @@ -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 case 0: { - if(!ptr_data->addr_is_good || - (!(params->flags & EV_StringFlag_DisableAddresses) && - params->flags & EV_StringFlag_AddressesBeforeContent)) + if(!(params->flags & EV_StringFlag_DisableAddresses) && + (!ptr_data->addr_is_good || params->flags & EV_StringFlag_AddressesBeforeContent)) { Temp scratch = scratch_begin(&arena, 1); 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); ptr_data->did_pre_prefix_ptr = 1; + need_pop = !ptr_data->addr_is_good; scratch_end(scratch); } - need_pop = !ptr_data->addr_is_good; + else + { + need_pop = 0; + } }break; //- rjf: step 1 -> try "prefix content", which we want to print before the pointer value, diff --git a/src/raddbg/generated/raddbg.meta.c b/src/raddbg/generated/raddbg.meta.c index ca2440a2..b96d8a43 100644 --- a/src/raddbg/generated/raddbg.meta.c +++ b/src/raddbg/generated/raddbg.meta.c @@ -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("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("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("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}")}, diff --git a/src/raddbg/raddbg.mdesk b/src/raddbg/raddbg.mdesk index 57ef3e0e..f3cd2a42 100644 --- a/src/raddbg/raddbg.mdesk +++ b/src/raddbg/raddbg.mdesk @@ -779,7 +779,7 @@ RD_VocabTable: //- rjf: @schema recent_project { recent_project, 0, - ```x:{'path':path}```, + ```x:{'path':path, 'name':string}```, } //- rjf: @schema machine diff --git a/src/raddbg/raddbg_core.c b/src/raddbg/raddbg_core.c index 7b86947a..a107a3a9 100644 --- a/src/raddbg/raddbg_core.c +++ b/src/raddbg/raddbg_core.c @@ -227,6 +227,14 @@ rd_location_from_cfg(CFG_Node *cfg) 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 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; 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_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_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")); diff --git a/src/raddbg/raddbg_core.h b/src/raddbg/raddbg_core.h index 498300dc..f5e777d3 100644 --- a/src/raddbg/raddbg_core.h +++ b/src/raddbg/raddbg_core.h @@ -618,6 +618,7 @@ internal Vec4F32 rd_color_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 String8 rd_name_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_path_from_cfg(CFG_Node *cfg); diff --git a/src/raddbg/raddbg_main.c b/src/raddbg/raddbg_main.c index 29eb65ad..33973c56 100644 --- a/src/raddbg/raddbg_main.c +++ b/src/raddbg/raddbg_main.c @@ -9,8 +9,6 @@ // [ ] 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 // -// [ ] external window focusing bugs -// // [ ] PDB -> RDI conversion memory usage // [ ] more things should move to user data, but project-tagged - like // recent files, watches?, etc. @@ -44,7 +42,7 @@ // //- jeff notes // [ ] 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 // [ ] (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 // [ ] adjust menu bar rendering when not focused // [ ] treat int 0x29 similarly to int3 -// [ ] auto_step, launching terminal, terminal steals focus from debugger... // //- memory view // [ ] 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] no selected thread -> causing evaluation failures, e.g. with go-to-definition // [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 diff --git a/src/raddbg/raddbg_widgets.c b/src/raddbg/raddbg_widgets.c index 54bee4a7..da8f2c83 100644 --- a/src/raddbg/raddbg_widgets.c +++ b/src/raddbg/raddbg_widgets.c @@ -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); RD_Location loc = rd_location_from_cfg(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 expr_string = rd_expr_from_cfg(cfg); String8 collection_name = {0}; @@ -163,10 +164,10 @@ rd_title_fstrs_from_cfg(Arena *arena, CFG_Node *cfg, B32 include_extras) } } - //- rjf: push label - if(label_string.size != 0) + //- rjf: push name + if(name_string.size != 0) { - dr_fstrs_push_new(arena, &result, ¶ms, 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, ¶ms, name_string); dr_fstrs_push_new(arena, &result, ¶ms, str8_lit(" ")); start_secondary(); }