diff --git a/src/eval/eval_ir.c b/src/eval/eval_ir.c index 72198bec..8fb35c42 100644 --- a/src/eval/eval_ir.c +++ b/src/eval/eval_ir.c @@ -391,7 +391,7 @@ E_LOOKUP_INFO_FUNCTION_DEF(slice) { base_ptr_member = &members.v[idx]; } - if(opl_ptr_member == 0 && e_type_kind_is_pointer_or_ref(member_type_kind)) + else if(base_ptr_member != 0 && opl_ptr_member == 0 && e_type_kind_is_pointer_or_ref(member_type_kind)) { opl_ptr_member = &members.v[idx]; } @@ -458,7 +458,7 @@ E_LOOKUP_INFO_FUNCTION_DEF(slice) } // rjf: fill - if(count_member && base_ptr_member) + if((count_member || opl_ptr_member) && base_ptr_member) { E_SliceAccel *accel = push_array(arena, E_SliceAccel, 1); accel->arch = arch; diff --git a/src/raddbg/generated/raddbg.meta.c b/src/raddbg/generated/raddbg.meta.c index b75bd92f..db9b2325 100644 --- a/src/raddbg/generated/raddbg.meta.c +++ b/src/raddbg/generated/raddbg.meta.c @@ -4,7 +4,7 @@ //- GENERATED CODE C_LINKAGE_BEGIN -RD_VocabInfo rd_vocab_info_table[295] = +RD_VocabInfo rd_vocab_info_table[294] = { {str8_lit_comp("auto_view_rule"), str8_lit_comp("auto_view_rules"), str8_lit_comp("Auto View Rule"), str8_lit_comp("Auto View Rules"), RD_IconKind_Binoculars}, {str8_lit_comp("file_path_map"), str8_lit_comp("file_path_maps"), str8_lit_comp("File Path Map"), str8_lit_comp("File Path Maps"), RD_IconKind_FileOutline}, @@ -272,7 +272,6 @@ RD_VocabInfo rd_vocab_info_table[295] = {str8_lit_comp("search_backwards"), str8_lit_comp(""), str8_lit_comp("Search Backwards"), str8_lit_comp(""), RD_IconKind_Find}, {str8_lit_comp("getting_started"), str8_lit_comp(""), str8_lit_comp("Getting Started"), str8_lit_comp(""), RD_IconKind_QuestionMark}, {str8_lit_comp("commands"), str8_lit_comp(""), str8_lit_comp("Commands"), str8_lit_comp(""), RD_IconKind_List}, -{str8_lit_comp("target"), str8_lit_comp(""), str8_lit_comp("Target"), str8_lit_comp(""), RD_IconKind_Target}, {str8_lit_comp("targets"), str8_lit_comp(""), str8_lit_comp("Targets"), str8_lit_comp(""), RD_IconKind_Target}, {str8_lit_comp("file_path_map"), str8_lit_comp(""), str8_lit_comp("File Path Map"), str8_lit_comp(""), RD_IconKind_FileOutline}, {str8_lit_comp("auto_view_rules"), str8_lit_comp(""), str8_lit_comp("Auto View Rules"), str8_lit_comp(""), RD_IconKind_Binoculars}, @@ -363,7 +362,7 @@ Rng1U64 rd_reg_slot_range_table[40] = {OffsetOf(RD_Regs, os_event), OffsetOf(RD_Regs, os_event) + sizeof(OS_Event *)}, }; -RD_CmdKindInfo rd_cmd_kind_info_table[213] = +RD_CmdKindInfo rd_cmd_kind_info_table[212] = { {0}, { str8_lit_comp("launch_and_run"), str8_lit_comp("Starts debugging a new instance of a target, then runs."), str8_lit_comp("launch,start,run,target"), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*1)|(RD_QueryFlag_Required*1), RD_RegSlot_Cfg, str8_lit_comp("query:targets"), str8_lit_comp(""), CTRL_EntityKind_Null}}, @@ -549,7 +548,6 @@ RD_CmdKindInfo rd_cmd_kind_info_table[213] = { str8_lit_comp("search_backwards"), str8_lit_comp("Begins searching backwards within the active interface."), str8_lit_comp("sort,search,filter,find"), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*1)|(RD_QueryFlag_KeepOldInput*1)|(RD_QueryFlag_SelectOldInput*1)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*1), RD_RegSlot_String, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}}, { str8_lit_comp("getting_started"), str8_lit_comp("Opens the menu for information on getting started."), str8_lit_comp("tutorial,help"), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}}, { str8_lit_comp("commands"), str8_lit_comp("Opens the list of all commands."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*0)|(RD_CmdKindFlag_ListInIPCDocs*0), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}}, -{ str8_lit_comp("target"), str8_lit_comp("Opens the editor for a target."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*0)|(RD_CmdKindFlag_ListInIPCDocs*0), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}}, { str8_lit_comp("targets"), str8_lit_comp("Opens the list of all targets."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}}, { str8_lit_comp("file_path_map"), str8_lit_comp("Opens the file path mapping editor."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}}, { str8_lit_comp("auto_view_rules"), str8_lit_comp("Opens the auto view rule editor."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), CTRL_EntityKind_Null}}, diff --git a/src/raddbg/generated/raddbg.meta.h b/src/raddbg/generated/raddbg.meta.h index 11182c9d..5f3daa04 100644 --- a/src/raddbg/generated/raddbg.meta.h +++ b/src/raddbg/generated/raddbg.meta.h @@ -237,7 +237,6 @@ RD_CmdKind_Search, RD_CmdKind_SearchBackwards, RD_CmdKind_GettingStarted, RD_CmdKind_Commands, -RD_CmdKind_Target, RD_CmdKind_Targets, RD_CmdKind_FilePathMap, RD_CmdKind_AutoViewRules, @@ -631,7 +630,7 @@ RD_Query query; .os_event = rd_regs()->os_event,\ C_LINKAGE_BEGIN -extern RD_VocabInfo rd_vocab_info_table[295]; +extern RD_VocabInfo rd_vocab_info_table[294]; extern RD_NameSchemaInfo rd_name_schema_info_table[12]; extern Rng1U64 rd_reg_slot_range_table[40]; extern String8 rd_binding_version_remap_old_name_table[8]; diff --git a/src/raddbg/raddbg.mdesk b/src/raddbg/raddbg.mdesk index f65064dc..e1b57e48 100644 --- a/src/raddbg/raddbg.mdesk +++ b/src/raddbg/raddbg.mdesk @@ -581,7 +581,6 @@ RD_CmdTable: // | | | | //- rjf: view drivers {GettingStarted 1 1 "" Null null Nil Null 0 0 0 0 0 0 0 QuestionMark "getting_started" "Getting Started" "Opens the menu for information on getting started." "tutorial,help" "" } {Commands 0 0 "" Null null Nil Null 0 0 0 0 0 0 0 List "commands" "Commands" "Opens the list of all commands." "" "" } - {Target 0 0 "" Null null Nil Null 0 0 0 0 0 0 0 Target "target" "Target" "Opens the editor for a target." "" "" } {Targets 1 1 "" Null null Nil Null 0 0 0 0 0 0 0 Target "targets" "Targets" "Opens the list of all targets." "" "" } {FilePathMap 1 1 "" Null null Nil Null 0 0 0 0 0 0 0 FileOutline "file_path_map" "File Path Map" "Opens the file path mapping editor." "" "" } {AutoViewRules 1 1 "" Null null Nil Null 0 0 0 0 0 0 0 Binoculars "auto_view_rules" "Auto View Rules" "Opens the auto view rule editor." "" "" } diff --git a/src/raddbg/raddbg_core.c b/src/raddbg/raddbg_core.c index cce6a98b..eae92e73 100644 --- a/src/raddbg/raddbg_core.c +++ b/src/raddbg/raddbg_core.c @@ -2012,7 +2012,7 @@ internal B32 rd_cfg_is_project_filtered(RD_Cfg *cfg) { RD_Cfg *project = rd_cfg_child_from_string(cfg, str8_lit("project")); - B32 result = path_match_normalized(rd_state->project_path, project->first->string); + B32 result = (project != &rd_nil_cfg && !path_match_normalized(rd_state->project_path, project->first->string)); return result; } @@ -3720,6 +3720,17 @@ rd_view_ui(Rng2F32 rect) } } + ////////////////////////////// + //- rjf: consume query-completion events, if this view is being used as a query + // + if(vs->is_searching && + ui_is_focus_active() && + ui_slot_press(UI_EventActionSlot_Accept)) + { + // TODO(rjf): // TODO(rjf): // TODO(rjf): // TODO(rjf): // TODO(rjf): + // TODO(rjf): // TODO(rjf): // TODO(rjf): // TODO(rjf): // TODO(rjf): + } + ////////////////////////////// //- rjf: consume events & perform navigations/edits - calculate state // @@ -4812,7 +4823,7 @@ rd_view_ui(Rng2F32 rect) B32 row_selected = (selection_tbl.min.y <= global_row_idx+1 && global_row_idx+1 <= selection_tbl.max.y); B32 row_expanded = ev_expansion_from_key(eval_view, row->key); B32 next_row_expanded = row_expanded; - B32 row_is_expandable = ev_row_is_expandable(row); + B32 row_is_expandable = row_info->can_expand; if(implicit_root && row_depth > 0) { row_depth -= 1; @@ -8149,6 +8160,17 @@ rd_window_frame(void) { build_hover_eval = 0; } + else if(hover_eval.space.kind == RD_EvalSpaceKind_MetaCfg && + rd_cfg_from_eval_space(hover_eval.space) == &rd_nil_cfg) + { + build_hover_eval = 0; + } + else if((hover_eval.space.kind == RD_EvalSpaceKind_MetaCtrlEntity || + hover_eval.space.kind == RD_EvalSpaceKind_CtrlEntity) && + rd_ctrl_entity_from_eval_space(hover_eval.space) == &ctrl_entity_nil) + { + build_hover_eval = 0; + } // rjf: reset open animation if(ws->hover_eval_string.size == 0) diff --git a/src/raddbg/raddbg_views.c b/src/raddbg/raddbg_views.c index a998c148..810bc207 100644 --- a/src/raddbg/raddbg_views.c +++ b/src/raddbg/raddbg_views.c @@ -888,6 +888,7 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row) RD_WatchRowInfo info = { .module = &ctrl_entity_nil, + .can_expand = ev_row_is_expandable(row), .group_cfg_parent = &rd_nil_cfg, .group_cfg_child = &rd_nil_cfg, .group_entity = &ctrl_entity_nil, @@ -1137,15 +1138,19 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row) // rjf: folder / file rows else if(info.eval.space.kind == E_SpaceKind_FileSystem) { - String8 file_path = e_string_from_id(info.eval.value.u64); - DR_FStrList fstrs = rd_title_fstrs_from_file_path(arena, file_path); E_Type *type = e_type_from_key__cached(info.eval.irtree.type_key); - if(str8_match(type->name, str8_lit("folder"), 0)) + if(type->kind == E_TypeKind_Set) { + String8 file_path = e_string_from_id(info.eval.value.u64); + DR_FStrList fstrs = rd_title_fstrs_from_file_path(arena, file_path); rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Button|RD_WatchCellFlag_IsNonCode, .pct = 1.f, .fstrs = fstrs); + if(str8_match(type->name, str8_lit("file"), 0)) + { + info.can_expand = 0; + } } else { @@ -1155,22 +1160,12 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row) RD_Cfg *w_cfg = style->first; F32 next_pct = 0; #define take_pct() (next_pct = (F32)f64_from_str8(w_cfg->string), w_cfg = w_cfg->next, next_pct) - rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, - .flags = RD_WatchCellFlag_Button|RD_WatchCellFlag_IsNonCode, - .default_pct = 0.35f, - .pct = take_pct(), - .fstrs = fstrs); - rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Eval, .default_pct = 0.65f, .pct = take_pct()); + rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .default_pct = 0.25f, .pct = take_pct()); + rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Eval, .default_pct = 0.75f, .pct = take_pct()); #undef take_pct } } - // rjf: lister rows - else if(rd_cfg_child_from_string(rd_cfg_from_id(rd_regs()->view), str8_lit("lister")) != &rd_nil_cfg) - { - rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Button, .pct = 1.f); - } - // rjf: singular cell for view ui else if(info.view_ui_rule != &rd_nil_view_ui_rule) { @@ -1183,6 +1178,30 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row) rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .pct = 1.f); } + // rjf: for meta-cfg evaluation spaces, only do expr/value + else if(info.eval.space.kind == RD_EvalSpaceKind_MetaCfg || + info.eval.space.kind == RD_EvalSpaceKind_MetaCmd || + info.eval.space.kind == RD_EvalSpaceKind_MetaCtrlEntity || + info.eval.space.kind == E_SpaceKind_File) + { + info.cell_style_key = str8_lit("expr_and_eval"); + RD_Cfg *view = rd_cfg_from_id(rd_regs()->view); + RD_Cfg *style = rd_cfg_child_from_string(view, info.cell_style_key); + RD_Cfg *w_cfg = style->first; + F32 next_pct = 0; +#define take_pct() (next_pct = (F32)f64_from_str8(w_cfg->string), w_cfg = w_cfg->next, next_pct) + rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .default_pct = 0.25f, .pct = take_pct()); + rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Eval, .default_pct = 0.75f, .pct = take_pct()); +#undef take_pct + } + + // rjf: lister rows + else if(rd_cfg_child_from_string(rd_cfg_from_id(rd_regs()->view), str8_lit("lister")) != &rd_nil_cfg) + { + info.can_expand = 0; + rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Button, .pct = 1.f); + } + // rjf: procedures collections get only expr/value/view-rule else if(block_type->kind == E_TypeKind_Set && str8_match(block_type->name, str8_lit("procedures"), 0)) { @@ -1198,22 +1217,6 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row) #undef take_pct } - // rjf: for meta-cfg evaluation spaces, only do expr/value - else if(info.eval.space.kind == RD_EvalSpaceKind_MetaCfg || - info.eval.space.kind == RD_EvalSpaceKind_MetaCmd || - info.eval.space.kind == RD_EvalSpaceKind_MetaCtrlEntity) - { - info.cell_style_key = str8_lit("expr_and_eval"); - RD_Cfg *view = rd_cfg_from_id(rd_regs()->view); - RD_Cfg *style = rd_cfg_child_from_string(view, info.cell_style_key); - RD_Cfg *w_cfg = style->first; - F32 next_pct = 0; -#define take_pct() (next_pct = (F32)f64_from_str8(w_cfg->string), w_cfg = w_cfg->next, next_pct) - rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .default_pct = 0.25f, .pct = take_pct()); - rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Eval, .default_pct = 0.75f, .pct = take_pct()); -#undef take_pct - } - // rjf: callstack frames else if(info.callstack_thread != &ctrl_entity_nil) { @@ -1465,9 +1468,13 @@ rd_info_from_watch_row_cell(Arena *arena, EV_Row *row, EV_StringFlags string_fla } else if(result.eval.space.kind == E_SpaceKind_FileSystem) { - String8 file_path = e_string_from_id(result.eval.value.u64); - result.fstrs = rd_title_fstrs_from_file_path(arena, file_path); - result.flags |= RD_WatchCellFlag_Button; + E_Type *type = e_type_from_key__cached(result.eval.irtree.type_key); + if(type->kind == E_TypeKind_Set) + { + String8 file_path = e_string_from_id(result.eval.value.u64); + result.fstrs = rd_title_fstrs_from_file_path(arena, file_path); + result.flags |= RD_WatchCellFlag_Button; + } } }break; case RD_WatchCellKind_Eval: @@ -1513,9 +1520,13 @@ rd_info_from_watch_row_cell(Arena *arena, EV_Row *row, EV_StringFlags string_fla } else if(result.eval.space.kind == E_SpaceKind_FileSystem) { - String8 file_path = e_string_from_id(result.eval.value.u64); - result.fstrs = rd_title_fstrs_from_file_path(arena, file_path); - result.flags |= RD_WatchCellFlag_Button; + E_Type *type = e_type_from_key__cached(result.eval.irtree.type_key); + if(type->kind == E_TypeKind_Set) + { + String8 file_path = e_string_from_id(result.eval.value.u64); + result.fstrs = rd_title_fstrs_from_file_path(arena, file_path); + result.flags |= RD_WatchCellFlag_Button; + } } }break; } diff --git a/src/raddbg/raddbg_views.h b/src/raddbg/raddbg_views.h index da9c8420..5bc84acd 100644 --- a/src/raddbg/raddbg_views.h +++ b/src/raddbg/raddbg_views.h @@ -89,6 +89,7 @@ struct RD_WatchRowInfo { E_Eval eval; CTRL_Entity *module; + B32 can_expand; B32 expr_is_editable; String8 group_cfg_name; RD_Cfg *group_cfg_parent;