[Lldb-commits] [PATCH] D120892: [lldb] Warn when we fail to find dwo/dwp files

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 9 05:31:33 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG8f6ee17f22a7: [lldb] Warn when we fail to find dwo/dwp files (authored by labath).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120892/new/

https://reviews.llvm.org/D120892

Files:
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/test/Shell/SymbolFile/DWARF/x86/dwo-not-found-warning.cpp


Index: lldb/test/Shell/SymbolFile/DWARF/x86/dwo-not-found-warning.cpp
===================================================================
--- /dev/null
+++ lldb/test/Shell/SymbolFile/DWARF/x86/dwo-not-found-warning.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang --target=x86_64-pc-linux -g -gsplit-dwarf -c %s -o %t.o
+// RUN: rm %t.dwo
+// RUN: %lldb %t.o -o "br set -n main" -o exit 2>&1 | FileCheck %s
+
+// CHECK: warning: {{.*}} unable to locate separate debug file (dwo, dwp). Debugging will be degraded.
+
+int main() { return 47; }
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -560,6 +560,7 @@
   /// address in the module.
   lldb::addr_t m_first_code_address = LLDB_INVALID_ADDRESS;
   lldb_private::StatsDuration m_parse_time;
+  std::atomic_flag m_dwo_warning_issued = ATOMIC_FLAG_INIT;
 };
 
 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARF_H
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1746,8 +1746,14 @@
     dwo_file.AppendPathComponent(dwo_name);
   }
 
-  if (!FileSystem::Instance().Exists(dwo_file))
+  if (!FileSystem::Instance().Exists(dwo_file)) {
+    if (m_dwo_warning_issued.test_and_set(std::memory_order_relaxed) == false) {
+      GetObjectFile()->GetModule()->ReportWarning(
+          "unable to locate separate debug file (dwo, dwp). Debugging will be "
+          "degraded.");
+    }
     return nullptr;
+  }
 
   const lldb::offset_t file_offset = 0;
   DataBufferSP dwo_file_data_sp;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120892.414077.patch
Type: text/x-patch
Size: 1845 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220309/be8033d6/attachment.bin>


More information about the lldb-commits mailing list