[Lldb-commits] [lldb] Add `target modules dump separate-debug-info` (PR #66035)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 14 14:28:10 PDT 2023


================
@@ -162,6 +163,21 @@ void SymbolFile::AssertModuleLock() {
 
 SymbolFile::RegisterInfoResolver::~RegisterInfoResolver() = default;
 
+bool SymbolFile::ListSeparateDebugInfoFiles(StructuredData::Dictionary &d) {
+  StructuredData::Array array;
+  std::optional<ConstString> debug_info_type = GetSeparateDebugInfoFiles(array);
+  if (!debug_info_type) {
+    return false;
+  }
+
+  d.AddStringItem("type", debug_info_type.value());
+  d.AddStringItem("symfile", GetMainObjectFile()->GetFileSpec().GetPath());
+  d.AddItem("separate-debug-info-files",
+            std::make_shared<StructuredData::Array>(std::move(array)));
----------------
clayborg wrote:

We should change the SymbolFile API to take a Dictionary and move the code that adds the "type", "symfile" and "separate-debug-info-files" into the dictionary over into SymbolFileDWARF. We then no longer need this SymbolFile::ListSeparateDebugInfoFiles  function and the callers of this function can now just use SymbolFile:: GetSeparateDebugInfoFiles(StructuredData::Dictionary &d).

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


More information about the lldb-commits mailing list