[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
Thu Jan 29 12:48:55 PST 2026


================
@@ -4215,6 +4215,30 @@ void SymbolFileDWARF::DumpClangAST(Stream &s, llvm::StringRef filter) {
   clang->Dump(s.AsRawOstream(), filter);
 }
 
+lldb_private::ModuleSpecList SymbolFileDWARF::GetSeparateDebugInfoFiles() {
+  DWARFDebugInfo &info = DebugInfo();
+  const size_t num_cus = info.GetNumUnits();
+  lldb_private::ModuleSpecList spec_list;
+  for (uint32_t cu_idx = 0; cu_idx < num_cus; ++cu_idx) {
+    DWARFUnit *unit = info.GetUnitAtIndex(cu_idx);
+    DWARFCompileUnit *dwarf_cu = llvm::dyn_cast<DWARFCompileUnit>(unit);
+    if (dwarf_cu == nullptr)
+      continue;
+
+    if (!dwarf_cu->GetDWOId().has_value())
+      continue;
+
+    SymbolFile *dwo_symfile = dwarf_cu->GetDwoSymbolFile();
+    if (!dwo_symfile)
+      continue;
+
+    lldb_private::FileSpec symfile_spec =
+        dwo_symfile->GetObjectFile()->GetFileSpec();
----------------
clayborg wrote:

If we can't find the symbol file it would be nice to still get the data. We should also store more than just the filespec. 

If we have a .dwp file, it should be specified as the FileSpec, the .dwo name should be filled into the `ModuleSpec.m_object_name` and the DWO ID should be filled into the `ModuleSpec.m_uuid`.  Regardless if we have the file or not. 

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


More information about the lldb-commits mailing list