From 87a1dd84ec6d0ad8660c60616d56d5b188863fbb Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Fri, 6 Dec 2024 12:31:31 -0800 Subject: [PATCH] delete raddbg layer duplicative ctrl entity kinds / related code; we are now fully moved onto the ctrl system for ctrl entities --- src/dbg_engine/dbg_engine_core.c | 174 ----------------------------- src/raddbg/generated/raddbg.meta.c | 42 +------ src/raddbg/generated/raddbg.meta.h | 17 +-- src/raddbg/raddbg.mdesk | 7 -- src/raddbg/raddbg_core.c | 66 ----------- src/raddbg/raddbg_core.h | 3 - 6 files changed, 12 insertions(+), 297 deletions(-) diff --git a/src/dbg_engine/dbg_engine_core.c b/src/dbg_engine/dbg_engine_core.c index 56f4c67d2..e2a24d0a1 100644 --- a/src/dbg_engine/dbg_engine_core.c +++ b/src/dbg_engine/dbg_engine_core.c @@ -1756,133 +1756,10 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P MTX_Op op = {r1u64(0, 0xffffffffffffffffull), str8_lit("[new session]\n")}; mtx_push_op(d_state->output_log_key, op); } - - // rjf: create entity - RD_Entity *machine = rd_machine_entity_from_machine_id(event->entity.machine_id); - RD_Entity *entity = rd_entity_alloc(machine, RD_EntityKind_Process); - rd_entity_equip_u64(entity, event->msg_id); - rd_entity_equip_ctrl_handle(entity, event->entity); - rd_entity_equip_ctrl_id(entity, event->entity_id); - rd_entity_equip_arch(entity, event->arch); - }break; - - case CTRL_EventKind_NewThread: - { - // rjf: create entity - RD_Entity *parent = rd_entity_from_ctrl_handle(event->parent); - RD_Entity *entity = rd_entity_alloc(parent, RD_EntityKind_Thread); - rd_entity_equip_ctrl_handle(entity, event->entity); - rd_entity_equip_arch(entity, event->arch); - rd_entity_equip_ctrl_id(entity, event->entity_id); - rd_entity_equip_stack_base(entity, event->stack_base); - rd_entity_equip_vaddr(entity, event->rip_vaddr); - if(event->string.size != 0) - { - rd_entity_equip_name(entity, event->string); - } - - // rjf: find any pending thread names correllating with this TID -> equip name if found match - { - RD_EntityList pending_thread_names = rd_query_cached_entity_list_with_kind(RD_EntityKind_PendingThreadName); - for(RD_EntityNode *n = pending_thread_names.first; n != 0; n = n->next) - { - RD_Entity *pending_thread_name = n->entity; - if(event->entity.machine_id == pending_thread_name->ctrl_handle.machine_id && event->entity_id == pending_thread_name->ctrl_id) - { - rd_entity_mark_for_deletion(pending_thread_name); - rd_entity_equip_name(entity, pending_thread_name->string); - break; - } - } - } - - // rjf: determine index in process - U64 thread_idx_in_process = 0; - for(RD_Entity *child = parent->first; !rd_entity_is_nil(child); child = child->next) - { - if(child == entity) - { - break; - } - if(child->kind == RD_EntityKind_Thread) - { - thread_idx_in_process += 1; - } - } - - // rjf: build default thread color table - Vec4F32 thread_colors[] = - { - rd_rgba_from_theme_color(RD_ThemeColor_Thread0), - rd_rgba_from_theme_color(RD_ThemeColor_Thread1), - rd_rgba_from_theme_color(RD_ThemeColor_Thread2), - rd_rgba_from_theme_color(RD_ThemeColor_Thread3), - rd_rgba_from_theme_color(RD_ThemeColor_Thread4), - rd_rgba_from_theme_color(RD_ThemeColor_Thread5), - rd_rgba_from_theme_color(RD_ThemeColor_Thread6), - rd_rgba_from_theme_color(RD_ThemeColor_Thread7), - }; - - // rjf: pick color - Vec4F32 thread_color = thread_colors[thread_idx_in_process % ArrayCount(thread_colors)]; - - // rjf: equip color - rd_entity_equip_color_rgba(entity, thread_color); - }break; - - case CTRL_EventKind_NewModule: - { - // rjf: grab process - RD_Entity *parent = rd_entity_from_ctrl_handle(event->parent); - - // rjf: determine if this is the first module - B32 is_first = 0; - if(rd_entity_is_nil(rd_entity_child_from_kind(parent, RD_EntityKind_Module))) - { - is_first = 1; - } - - // rjf: create module entity - RD_Entity *module = rd_entity_alloc(parent, RD_EntityKind_Module); - rd_entity_equip_ctrl_handle(module, event->entity); - rd_entity_equip_arch(module, event->arch); - rd_entity_equip_name(module, event->string); - rd_entity_equip_vaddr_rng(module, event->vaddr_rng); - rd_entity_equip_vaddr(module, event->rip_vaddr); - rd_entity_equip_timestamp(module, event->timestamp); - - // rjf: is first -> find target, equip process & module & first thread with target color - if(is_first) - { - RD_EntityList targets = rd_query_cached_entity_list_with_kind(RD_EntityKind_Target); - for(RD_EntityNode *n = targets.first; n != 0; n = n->next) - { - RD_Entity *target = n->entity; - RD_Entity *exe = rd_entity_child_from_kind(target, RD_EntityKind_Executable); - String8 exe_name = exe->string; - String8 exe_name_normalized = path_normalized_from_string(scratch.arena, exe_name); - String8 module_name_normalized = path_normalized_from_string(scratch.arena, module->string); - if(str8_match(exe_name_normalized, module_name_normalized, StringMatchFlag_CaseInsensitive) && - target->flags & RD_EntityFlag_HasColor) - { - RD_Entity *first_thread = rd_entity_child_from_kind(parent, RD_EntityKind_Thread); - Vec4F32 rgba = rd_rgba_from_entity(target); - rd_entity_equip_color_rgba(parent, rgba); - rd_entity_equip_color_rgba(first_thread, rgba); - rd_entity_equip_color_rgba(module, rgba); - break; - } - } - } }break; case CTRL_EventKind_EndProc: { - U32 pid = event->entity_id; - RD_Entity *process = rd_entity_from_ctrl_handle(event->entity); - rd_entity_mark_for_deletion(process); - - // rjf: report D_EventNode *n = push_array(arena, D_EventNode, 1); SLLQueuePush(result.first, result.last, n); result.count += 1; @@ -1891,32 +1768,6 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P evt->code = event->u64_code; }break; - case CTRL_EventKind_EndThread: - { - RD_Entity *thread = rd_entity_from_ctrl_handle(event->entity); - rd_entity_mark_for_deletion(thread); - }break; - - case CTRL_EventKind_EndModule: - { - RD_Entity *module = rd_entity_from_ctrl_handle(event->entity); - rd_entity_mark_for_deletion(module); - }break; - - //- rjf: debug info changes - - case CTRL_EventKind_ModuleDebugInfoPathChange: - { - RD_Entity *module = rd_entity_from_ctrl_handle(event->entity); - RD_Entity *debug_info = rd_entity_child_from_kind(module, RD_EntityKind_DebugInfoPath); - if(rd_entity_is_nil(debug_info)) - { - debug_info = rd_entity_alloc(module, RD_EntityKind_DebugInfoPath); - } - rd_entity_equip_name(debug_info, event->string); - rd_entity_equip_timestamp(debug_info, event->timestamp); - }break; - //- rjf: debug strings case CTRL_EventKind_DebugString: @@ -1925,31 +1776,6 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P mtx_push_op(d_state->output_log_key, op); }break; - case CTRL_EventKind_ThreadName: - { - String8 string = event->string; - RD_Entity *entity = rd_entity_from_ctrl_handle(event->entity); - if(event->entity_id != 0) - { - entity = rd_entity_from_ctrl_id(event->entity.machine_id, event->entity_id); - } - if(rd_entity_is_nil(entity)) - { - RD_Entity *process = rd_entity_from_ctrl_handle(event->parent); - if(!rd_entity_is_nil(process)) - { - entity = rd_entity_alloc(process, RD_EntityKind_PendingThreadName); - rd_entity_equip_name(entity, string); - rd_entity_equip_ctrl_handle(entity, ctrl_handle_make(event->entity.machine_id, dmn_handle_zero())); - rd_entity_equip_ctrl_id(entity, event->entity_id); - } - } - if(!rd_entity_is_nil(entity)) - { - rd_entity_equip_name(entity, string); - } - }break; - //- rjf: memory case CTRL_EventKind_MemReserve:{}break; diff --git a/src/raddbg/generated/raddbg.meta.c b/src/raddbg/generated/raddbg.meta.c index b2b4621c8..bee354577 100644 --- a/src/raddbg/generated/raddbg.meta.c +++ b/src/raddbg/generated/raddbg.meta.c @@ -36,7 +36,7 @@ RD_CmdKind_Null, RD_CmdKind_Null, }; -String8 d_entity_kind_display_string_table[34] = +String8 d_entity_kind_display_string_table[29] = { str8_lit_comp("Nil"), str8_lit_comp("Root"), @@ -65,16 +65,11 @@ str8_lit_comp("Recent Project"), str8_lit_comp("Recent File"), str8_lit_comp("Source"), str8_lit_comp("Destination"), -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 Failure"), }; -String8 d_entity_kind_name_lower_table[34] = +String8 d_entity_kind_name_lower_table[29] = { str8_lit_comp("nil"), str8_lit_comp("root"), @@ -103,16 +98,11 @@ str8_lit_comp("recent_project"), str8_lit_comp("recent_file"), 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"), }; -String8 d_entity_kind_name_lower_plural_table[34] = +String8 d_entity_kind_name_lower_plural_table[29] = { str8_lit_comp("nils"), str8_lit_comp("roots"), @@ -141,16 +131,11 @@ str8_lit_comp("recent_projects"), str8_lit_comp("recent_files"), str8_lit_comp("sources"), str8_lit_comp("dests"), -str8_lit_comp("processes"), -str8_lit_comp("threads"), -str8_lit_comp("modules"), -str8_lit_comp("pending_thread_names"), -str8_lit_comp("debug_info_paths"), str8_lit_comp("conversion_tasks"), str8_lit_comp("conversion_fails"), }; -String8 d_entity_kind_name_label_table[34] = +String8 d_entity_kind_name_label_table[29] = { str8_lit_comp("Label"), str8_lit_comp("Label"), @@ -181,14 +166,9 @@ str8_lit_comp("Path"), str8_lit_comp("Path"), str8_lit_comp("Label"), str8_lit_comp("Label"), -str8_lit_comp("Label"), -str8_lit_comp("Label"), -str8_lit_comp("Label"), -str8_lit_comp("Label"), -str8_lit_comp("Label"), }; -RD_EntityKindFlags rd_entity_kind_flags_table[34] = +RD_EntityKindFlags rd_entity_kind_flags_table[29] = { (0*RD_EntityKindFlag_CanDelete) | (0*RD_EntityKindFlag_CanFreeze) | (0*RD_EntityKindFlag_CanEdit) | (0*RD_EntityKindFlag_CanRename) | (0*RD_EntityKindFlag_CanEnable) | (0*RD_EntityKindFlag_CanCondition) | (0*RD_EntityKindFlag_CanDuplicate) | (0*RD_EntityKindFlag_NameIsCode) | (0*RD_EntityKindFlag_NameIsPath) | (0*RD_EntityKindFlag_UserDefinedLifetime) | (0*RD_EntityKindFlag_IsSerializedToConfig), (0*RD_EntityKindFlag_CanDelete) | (0*RD_EntityKindFlag_CanFreeze) | (0*RD_EntityKindFlag_CanEdit) | (0*RD_EntityKindFlag_CanRename) | (0*RD_EntityKindFlag_CanEnable) | (0*RD_EntityKindFlag_CanCondition) | (0*RD_EntityKindFlag_CanDuplicate) | (0*RD_EntityKindFlag_NameIsCode) | (0*RD_EntityKindFlag_NameIsPath) | (0*RD_EntityKindFlag_UserDefinedLifetime) | (0*RD_EntityKindFlag_IsSerializedToConfig), @@ -217,11 +197,6 @@ RD_EntityKindFlags rd_entity_kind_flags_table[34] = (0*RD_EntityKindFlag_CanDelete) | (0*RD_EntityKindFlag_CanFreeze) | (0*RD_EntityKindFlag_CanEdit) | (0*RD_EntityKindFlag_CanRename) | (0*RD_EntityKindFlag_CanEnable) | (0*RD_EntityKindFlag_CanCondition) | (0*RD_EntityKindFlag_CanDuplicate) | (0*RD_EntityKindFlag_NameIsCode) | (1*RD_EntityKindFlag_NameIsPath) | (0*RD_EntityKindFlag_UserDefinedLifetime) | (1*RD_EntityKindFlag_IsSerializedToConfig), (0*RD_EntityKindFlag_CanDelete) | (0*RD_EntityKindFlag_CanFreeze) | (0*RD_EntityKindFlag_CanEdit) | (0*RD_EntityKindFlag_CanRename) | (0*RD_EntityKindFlag_CanEnable) | (0*RD_EntityKindFlag_CanCondition) | (0*RD_EntityKindFlag_CanDuplicate) | (0*RD_EntityKindFlag_NameIsCode) | (0*RD_EntityKindFlag_NameIsPath) | (0*RD_EntityKindFlag_UserDefinedLifetime) | (0*RD_EntityKindFlag_IsSerializedToConfig), (0*RD_EntityKindFlag_CanDelete) | (0*RD_EntityKindFlag_CanFreeze) | (0*RD_EntityKindFlag_CanEdit) | (0*RD_EntityKindFlag_CanRename) | (0*RD_EntityKindFlag_CanEnable) | (0*RD_EntityKindFlag_CanCondition) | (0*RD_EntityKindFlag_CanDuplicate) | (0*RD_EntityKindFlag_NameIsCode) | (0*RD_EntityKindFlag_NameIsPath) | (0*RD_EntityKindFlag_UserDefinedLifetime) | (0*RD_EntityKindFlag_IsSerializedToConfig), -(0*RD_EntityKindFlag_CanDelete) | (1*RD_EntityKindFlag_CanFreeze) | (0*RD_EntityKindFlag_CanEdit) | (1*RD_EntityKindFlag_CanRename) | (0*RD_EntityKindFlag_CanEnable) | (0*RD_EntityKindFlag_CanCondition) | (0*RD_EntityKindFlag_CanDuplicate) | (0*RD_EntityKindFlag_NameIsCode) | (0*RD_EntityKindFlag_NameIsPath) | (0*RD_EntityKindFlag_UserDefinedLifetime) | (0*RD_EntityKindFlag_IsSerializedToConfig), -(0*RD_EntityKindFlag_CanDelete) | (1*RD_EntityKindFlag_CanFreeze) | (0*RD_EntityKindFlag_CanEdit) | (1*RD_EntityKindFlag_CanRename) | (0*RD_EntityKindFlag_CanEnable) | (0*RD_EntityKindFlag_CanCondition) | (0*RD_EntityKindFlag_CanDuplicate) | (0*RD_EntityKindFlag_NameIsCode) | (0*RD_EntityKindFlag_NameIsPath) | (0*RD_EntityKindFlag_UserDefinedLifetime) | (0*RD_EntityKindFlag_IsSerializedToConfig), -(0*RD_EntityKindFlag_CanDelete) | (0*RD_EntityKindFlag_CanFreeze) | (0*RD_EntityKindFlag_CanEdit) | (0*RD_EntityKindFlag_CanRename) | (0*RD_EntityKindFlag_CanEnable) | (0*RD_EntityKindFlag_CanCondition) | (0*RD_EntityKindFlag_CanDuplicate) | (0*RD_EntityKindFlag_NameIsCode) | (0*RD_EntityKindFlag_NameIsPath) | (0*RD_EntityKindFlag_UserDefinedLifetime) | (0*RD_EntityKindFlag_IsSerializedToConfig), -(0*RD_EntityKindFlag_CanDelete) | (0*RD_EntityKindFlag_CanFreeze) | (0*RD_EntityKindFlag_CanEdit) | (0*RD_EntityKindFlag_CanRename) | (0*RD_EntityKindFlag_CanEnable) | (0*RD_EntityKindFlag_CanCondition) | (0*RD_EntityKindFlag_CanDuplicate) | (0*RD_EntityKindFlag_NameIsCode) | (0*RD_EntityKindFlag_NameIsPath) | (0*RD_EntityKindFlag_UserDefinedLifetime) | (0*RD_EntityKindFlag_IsSerializedToConfig), -(0*RD_EntityKindFlag_CanDelete) | (0*RD_EntityKindFlag_CanFreeze) | (0*RD_EntityKindFlag_CanEdit) | (0*RD_EntityKindFlag_CanRename) | (0*RD_EntityKindFlag_CanEnable) | (0*RD_EntityKindFlag_CanCondition) | (0*RD_EntityKindFlag_CanDuplicate) | (0*RD_EntityKindFlag_NameIsCode) | (0*RD_EntityKindFlag_NameIsPath) | (0*RD_EntityKindFlag_UserDefinedLifetime) | (0*RD_EntityKindFlag_IsSerializedToConfig), (0*RD_EntityKindFlag_CanDelete) | (0*RD_EntityKindFlag_CanFreeze) | (0*RD_EntityKindFlag_CanEdit) | (1*RD_EntityKindFlag_CanRename) | (0*RD_EntityKindFlag_CanEnable) | (0*RD_EntityKindFlag_CanCondition) | (0*RD_EntityKindFlag_CanDuplicate) | (0*RD_EntityKindFlag_NameIsCode) | (0*RD_EntityKindFlag_NameIsPath) | (0*RD_EntityKindFlag_UserDefinedLifetime) | (0*RD_EntityKindFlag_IsSerializedToConfig), (0*RD_EntityKindFlag_CanDelete) | (0*RD_EntityKindFlag_CanFreeze) | (0*RD_EntityKindFlag_CanEdit) | (1*RD_EntityKindFlag_CanRename) | (0*RD_EntityKindFlag_CanEnable) | (0*RD_EntityKindFlag_CanCondition) | (0*RD_EntityKindFlag_CanDuplicate) | (0*RD_EntityKindFlag_NameIsCode) | (0*RD_EntityKindFlag_NameIsPath) | (0*RD_EntityKindFlag_UserDefinedLifetime) | (0*RD_EntityKindFlag_IsSerializedToConfig), }; @@ -885,7 +860,7 @@ RD_ViewRuleInfo rd_view_rule_kind_info_table[35] = {str8_lit_comp("geo3d"), str8_lit_comp("Visualizes memory as 3D geometry."), str8_lit_comp("Geometry (3D)"), str8_lit_comp("x:{'count':expr, 'vtx':expr, 'vtx_size':expr}"), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(geo3d) , RD_VIEW_RULE_UI_FUNCTION_NAME(geo3d)}, }; -RD_IconKind rd_entity_kind_icon_kind_table[34] = +RD_IconKind rd_entity_kind_icon_kind_table[29] = { RD_IconKind_Null, RD_IconKind_Null, @@ -914,11 +889,6 @@ RD_IconKind_Briefcase, RD_IconKind_FileOutline, RD_IconKind_Null, RD_IconKind_Null, -RD_IconKind_Threads, -RD_IconKind_Thread, -RD_IconKind_Module, -RD_IconKind_Threads, -RD_IconKind_Module, RD_IconKind_Null, RD_IconKind_Null, }; diff --git a/src/raddbg/generated/raddbg.meta.h b/src/raddbg/generated/raddbg.meta.h index 2f817ccfe..827804075 100644 --- a/src/raddbg/generated/raddbg.meta.h +++ b/src/raddbg/generated/raddbg.meta.h @@ -44,11 +44,6 @@ RD_EntityKind_RecentProject, RD_EntityKind_RecentFile, RD_EntityKind_Source, RD_EntityKind_Dest, -RD_EntityKind_Process, -RD_EntityKind_Thread, -RD_EntityKind_Module, -RD_EntityKind_PendingThreadName, -RD_EntityKind_DebugInfoPath, RD_EntityKind_ConversionTask, RD_EntityKind_ConversionFail, RD_EntityKind_COUNT, @@ -766,11 +761,11 @@ extern String8 rd_cfg_src_string_table[4]; extern RD_CmdKind rd_cfg_src_load_cmd_kind_table[4]; extern RD_CmdKind rd_cfg_src_write_cmd_kind_table[4]; extern RD_CmdKind rd_cfg_src_apply_cmd_kind_table[4]; -extern String8 d_entity_kind_display_string_table[34]; -extern String8 d_entity_kind_name_lower_table[34]; -extern String8 d_entity_kind_name_lower_plural_table[34]; -extern String8 d_entity_kind_name_label_table[34]; -extern RD_EntityKindFlags rd_entity_kind_flags_table[34]; +extern String8 d_entity_kind_display_string_table[29]; +extern String8 d_entity_kind_name_lower_table[29]; +extern String8 d_entity_kind_name_lower_plural_table[29]; +extern String8 d_entity_kind_name_label_table[29]; +extern RD_EntityKindFlags rd_entity_kind_flags_table[29]; extern Rng1U64 rd_reg_slot_range_table[34]; extern RD_StringBindingPair rd_default_binding_table[110]; extern String8 rd_binding_version_remap_old_name_table[8]; @@ -784,7 +779,7 @@ extern EV_ViewRuleExprExpandRangeInfoHookFunctionType * rd_collection_expr_expan extern EV_ViewRuleExprExpandIDFromNumHookFunctionType * rd_collection_expr_expand_id_from_num_hook_function_table[18]; extern EV_ViewRuleExprExpandIDFromNumHookFunctionType * rd_collection_expr_expand_num_from_id_hook_function_table[18]; extern RD_ViewRuleInfo rd_view_rule_kind_info_table[35]; -extern RD_IconKind rd_entity_kind_icon_kind_table[34]; +extern RD_IconKind rd_entity_kind_icon_kind_table[29]; extern String8 rd_theme_preset_display_string_table[9]; extern String8 rd_theme_preset_code_string_table[9]; extern String8 rd_theme_color_version_remap_old_name_table[22]; diff --git a/src/raddbg/raddbg.mdesk b/src/raddbg/raddbg.mdesk index 7d9159a11..76bd357ab 100644 --- a/src/raddbg/raddbg.mdesk +++ b/src/raddbg/raddbg.mdesk @@ -114,13 +114,6 @@ RD_EntityKindTable: {Source source sources 0 0 0 0 0 0 0 0 0 0 0 "Path" Null "Source" } {Dest dest dests 0 0 0 0 0 0 0 0 0 0 0 "Path" Null "Destination" } - //- rjf: control system entities - {Process process processes 0 1 0 1 0 0 0 0 0 0 0 "Label" Threads "Process" } - {Thread thread threads 0 1 0 1 0 0 0 0 0 0 0 "Label" Thread "Thread" } - {Module module modules 0 0 0 0 0 0 0 0 0 0 0 "Label" Module "Module" } - {PendingThreadName pending_thread_name pending_thread_names 0 0 0 0 0 0 0 0 0 0 0 "Label" Threads "Pending Thread Name" } - {DebugInfoPath debug_info_path debug_info_paths 0 0 0 0 0 0 0 0 0 0 0 "Label" Module "Debug Info Path" } - //- rjf: parser task entities {ConversionTask conversion_task conversion_tasks 0 0 0 1 0 0 0 0 0 0 0 "Label" Null "Conversion Task" } {ConversionFail conversion_fail conversion_fails 0 0 0 1 0 0 0 0 0 0 0 "Label" Null "Conversion Failure" } diff --git a/src/raddbg/raddbg_core.c b/src/raddbg/raddbg_core.c index a8982b705..4af587652 100644 --- a/src/raddbg/raddbg_core.c +++ b/src/raddbg/raddbg_core.c @@ -1687,72 +1687,6 @@ rd_entity_from_id(RD_EntityID id) return result; } -internal RD_Entity * -rd_machine_entity_from_machine_id(CTRL_MachineID machine_id) -{ - RD_Entity *result = &d_nil_entity; - for(RD_Entity *e = rd_entity_root(); - !rd_entity_is_nil(e); - e = rd_entity_rec_depth_first_pre(e, &d_nil_entity).next) - { - if(e->kind == RD_EntityKind_Machine && e->ctrl_handle.machine_id == machine_id) - { - result = e; - break; - } - } - if(rd_entity_is_nil(result)) - { - result = rd_entity_alloc(rd_entity_root(), RD_EntityKind_Machine); - rd_entity_equip_ctrl_handle(result, ctrl_handle_make(machine_id, dmn_handle_zero())); - } - return result; -} - -internal RD_Entity * -rd_entity_from_ctrl_handle(CTRL_Handle handle) -{ - RD_Entity *result = &d_nil_entity; - if(handle.machine_id != 0 || handle.dmn_handle.u64[0] != 0) - { - for(RD_Entity *e = rd_entity_root(); - !rd_entity_is_nil(e); - e = rd_entity_rec_depth_first_pre(e, &d_nil_entity).next) - { - if(e->flags & RD_EntityFlag_HasCtrlHandle && - ctrl_handle_match(e->ctrl_handle, handle)) - { - result = e; - break; - } - } - } - return result; -} - -internal RD_Entity * -rd_entity_from_ctrl_id(CTRL_MachineID machine_id, U32 id) -{ - RD_Entity *result = &d_nil_entity; - if(id != 0) - { - for(RD_Entity *e = rd_entity_root(); - !rd_entity_is_nil(e); - e = rd_entity_rec_depth_first_pre(e, &d_nil_entity).next) - { - if(e->flags & RD_EntityFlag_HasCtrlHandle && - e->flags & RD_EntityFlag_HasCtrlID && - e->ctrl_handle.machine_id == machine_id && - e->ctrl_id == id) - { - result = e; - break; - } - } - } - return result; -} - internal RD_Entity * rd_entity_from_name_and_kind(String8 string, RD_EntityKind kind) { diff --git a/src/raddbg/raddbg_core.h b/src/raddbg/raddbg_core.h index f83977b82..e39e8f32e 100644 --- a/src/raddbg/raddbg_core.h +++ b/src/raddbg/raddbg_core.h @@ -1204,9 +1204,6 @@ internal String8List rd_possible_overrides_from_file_path(Arena *arena, String8 internal RD_Entity *rd_entity_root(void); internal RD_EntityList rd_push_entity_list_with_kind(Arena *arena, RD_EntityKind kind); internal RD_Entity *rd_entity_from_id(RD_EntityID id); -internal RD_Entity *rd_machine_entity_from_machine_id(CTRL_MachineID machine_id); -internal RD_Entity *rd_entity_from_ctrl_handle(CTRL_Handle handle); -internal RD_Entity *rd_entity_from_ctrl_id(CTRL_MachineID machine_id, U32 id); internal RD_Entity *rd_entity_from_name_and_kind(String8 string, RD_EntityKind kind); ////////////////////////////////