eliminate unneeded path-renormalization in debug info cache lookup

This commit is contained in:
Ryan Fleury
2025-06-25 10:52:29 -07:00
parent e2eb1cd6d6
commit 36f5597d8e
5 changed files with 24 additions and 19 deletions
+7 -2
View File
@@ -1366,14 +1366,16 @@ ctrl_entity_store_apply_events(CTRL_EntityCtxRWStore *store, CTRL_EventList *lis
}break;
case CTRL_EventKind_ModuleDebugInfoPathChange:
{
Temp scratch = scratch_begin(0, 0);
CTRL_Entity *module = ctrl_entity_from_handle(&store->ctx, event->entity);
CTRL_Entity *debug_info_path = ctrl_entity_child_from_kind(module, CTRL_EntityKind_DebugInfoPath);
if(debug_info_path == &ctrl_entity_nil)
{
debug_info_path = ctrl_entity_alloc(store, module, CTRL_EntityKind_DebugInfoPath, Arch_Null, ctrl_handle_zero(), 0);
}
ctrl_entity_equip_string(store, debug_info_path, event->string);
ctrl_entity_equip_string(store, debug_info_path, path_normalized_from_string(scratch.arena, event->string));
debug_info_path->timestamp = event->timestamp;
scratch_end(scratch);
}break;
//- rjf: dynamic, program-created breakpoints
@@ -3813,7 +3815,10 @@ ctrl_thread__entry_point(void *p)
CTRL_Entity *debug_info_path = ctrl_entity_child_from_kind(module, CTRL_EntityKind_DebugInfoPath);
DI_Key old_dbgi_key = {debug_info_path->string, debug_info_path->timestamp};
di_close(&old_dbgi_key);
OS_MutexScopeW(ctrl_state->ctrl_thread_entity_ctx_rw_mutex) ctrl_entity_equip_string(ctrl_state->ctrl_thread_entity_store, debug_info_path, path);
OS_MutexScopeW(ctrl_state->ctrl_thread_entity_ctx_rw_mutex)
{
ctrl_entity_equip_string(ctrl_state->ctrl_thread_entity_store, debug_info_path, path_normalized_from_string(scratch.arena, path));
}
U64 new_dbgi_timestamp = os_properties_from_file_path(path).modified;
debug_info_path->timestamp = new_dbgi_timestamp;
DI_Key new_dbgi_key = {debug_info_path->string, new_dbgi_timestamp};