[Lldb-commits] [lldb] [lldb][macOS] Index shared cache files by UUID & filename (PR #180874)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 12 11:58:23 PST 2026


================
@@ -866,20 +891,31 @@ static dispatch_data_t (*g_dyld_image_segment_data_4HWTrace)(
         return;
       UUID image_uuid(uuid_tmp, sizeof(uuid_t));
 
+      // Copy the filename into the const string pool to
+      // ensure lifetime.
+      ConstString installname(dyld_image_get_installname(image));
       Log *log = GetLog(LLDBLog::Modules);
       if (log && log->GetVerbose())
-        LLDB_LOGF(log, "sc file %s image %p", dyld_image_get_installname(image),
+        LLDB_LOGF(log, "sc file %s image %p", installname.GetCString(),
                   (void *)image);
 
       m_dyld_image_retain_4HWTrace(image);
-      m_caches[m_host_uuid][dyld_image_get_installname(image)] =
-          SharedCacheImageInfo(image_uuid, map_shared_cache_binary_segments,
-                               image);
+      m_file_infos.push_back(SharedCacheImageInfo(
+          installname, image_uuid, map_shared_cache_binary_segments, image));
     });
   });
   if (return_failed)
     return false;
 
+  // vector of SharedCacheImageInfos has been fully populated, we can
----------------
JDevlieghere wrote:

```suggestion
  // Vector of SharedCacheImageInfos has been fully populated, we can
```
or
```suggestion
  // std::vector of SharedCacheImageInfos has been fully populated, we can
```

https://github.com/llvm/llvm-project/pull/180874


More information about the lldb-commits mailing list