[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
Thu Mar 3 04:28:02 PST 2022
labath created this revision.
labath added a reviewer: JDevlieghere.
Herald added a project: All.
labath requested review of this revision.
Herald added a project: LLDB.
This ensures that the user is aware that many commands will not work
correctly.
We print the warning only once (per module) to avoid spamming the user
with potentially thousands of error messages.
Repository:
rG LLVM Github Monorepo
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
@@ -538,6 +538,7 @@
ExternalTypeModuleMap m_external_type_modules;
std::unique_ptr<lldb_private::DWARFIndex> m_index;
bool m_fetched_external_modules : 1;
+ bool m_dwo_warning_issued : 1;
lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type;
typedef std::set<DIERef> DIERefSet;
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -412,7 +412,7 @@
// contain the .o file index/ID
m_debug_map_module_wp(), m_debug_map_symfile(nullptr),
m_context(m_objfile_sp->GetModule()->GetSectionList(), dwo_section_list),
- m_fetched_external_modules(false),
+ m_fetched_external_modules(false), m_dwo_warning_issued(false),
m_supports_DW_AT_APPLE_objc_complete_type(eLazyBoolCalculate) {}
SymbolFileDWARF::~SymbolFileDWARF() = default;
@@ -1745,8 +1745,15 @@
dwo_file.AppendPathComponent(dwo_name);
}
- if (!FileSystem::Instance().Exists(dwo_file))
+ if (!FileSystem::Instance().Exists(dwo_file)) {
+ if (!m_dwo_warning_issued) {
+ m_dwo_warning_issued = true;
+ 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.412673.patch
Type: text/x-patch
Size: 2317 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220303/7dedcaf4/attachment.bin>
More information about the lldb-commits
mailing list