summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Module.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-03-18 10:45:02 +0000
committerPavel Labath <pavel@labath.sk>2019-03-18 10:45:02 +0000
commitdec963921b686752cf4eec7c977f163acf509e8c (patch)
tree48e1c1d9e13eee22d5d4d4d3b7ed660189c63628 /lldb/source/Core/Module.cpp
parent8cfd91dcc726307c2d35d17f5e13b9ac047c2187 (diff)
downloadbcm5719-llvm-dec963921b686752cf4eec7c977f163acf509e8c.tar.gz
bcm5719-llvm-dec963921b686752cf4eec7c977f163acf509e8c.zip
Reinitialize UnwindTable when the SymbolFile changes
Summary: This is a preparatory step to enable adding of unwind plans by symbol file plugins. Although at the surface it seems that currently symbol files have nothing to do with unwinding, this isn't entirely correct even now. The mere act of adding a symbol file can have the effect of making more sections (typically .debug_frame) available to the unwinding machinery, so that it can have more unwind strategies to choose from. Up until now, we've had a bug, which went largely unnoticed, where unwind info in the manually added symbols files (target symbols add) was being ignored during unwinding. Reinitializing the UnwindTable fixes that bug too. Reviewers: clayborg, jasonmolenda, alexshap Subscribers: jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D58347 llvm-svn: 356361
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r--lldb/source/Core/Module.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 262e15dbcc7..e9d9c5e7c5a 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -1300,6 +1300,12 @@ void Module::SectionFileAddressesChanged() {
sym_vendor->SectionFileAddressesChanged();
}
+UnwindTable &Module::GetUnwindTable() {
+ if (!m_unwind_table)
+ m_unwind_table.emplace(*this);
+ return *m_unwind_table;
+}
+
SectionList *Module::GetUnifiedSectionList() {
if (!m_sections_up)
m_sections_up = llvm::make_unique<SectionList>();
@@ -1446,6 +1452,10 @@ void Module::SetSymbolFileFileSpec(const FileSpec &file) {
// one
obj_file->ClearSymtab();
+ // Clear the unwind table too, as that may also be affected by the
+ // symbol file information.
+ m_unwind_table.reset();
+
// The symbol file might be a directory bundle ("/tmp/a.out.dSYM")
// instead of a full path to the symbol file within the bundle
// ("/tmp/a.out.dSYM/Contents/Resources/DWARF/a.out"). So we need to
OpenPOWER on IntegriCloud