[Lldb-commits] [lldb] [LLDB] Expose enumerator for separate-debug-info in SBModule (PR #144119)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 3 11:49:49 PDT 2026


================
@@ -1277,6 +1277,20 @@ void SymbolFileDWARFDebugMap::DumpClangAST(Stream &s, llvm::StringRef filter) {
   });
 }
 
+lldb_private::ModuleSpecList
+SymbolFileDWARFDebugMap::GetSeparateDebugInfoFiles() {
+  const uint32_t cu_count = GetNumCompileUnits();
+  lldb_private::ModuleSpecList spec_list;
+  for (uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
+    const auto &info = m_compile_unit_infos[cu_idx];
+    if (info.so_file.GetPath().empty())
+      continue;
+
+    spec_list.Append(lldb_private::FileSpec(info.oso_path));
----------------
clayborg wrote:

You also need to watch out for a path like "/path/foo.a(bar.o)". This code will split the path if needed and also get the OSO modification time correctly:

```
    ModuleSpec spec;
    FileSpec oso_file;
    ConstString oso_object;
    if (ObjectFile::SplitArchivePathWithObject(info.oso_path.GetStringRef(),
                                               oso_file, oso_object,
                                               /*must_exist=*/false)) {
      spec.GetFileSpec() = oso_file;
      spec.GetObjectName() = oso_object;
    } else {
      spec.GetFileSpec() = FileSpec(info.oso_path.GetStringRef());
    }
    spec.GetObjectModificationTime() = info.oso_mod_time;
    specs.Append(spec);
```

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


More information about the lldb-commits mailing list