aboutsummaryrefslogtreecommitdiffstats
path: root/source/Symbol/UnwindTable.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-10-23 17:53:01 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-10-23 17:53:01 +0000
commitead246455adf1a215ec2715dad6533073a6beb4e (patch)
treef3f97a47d77053bf96fe74cdbd6fae74380e8a92 /source/Symbol/UnwindTable.cpp
parentfdb00c4408990a0a63ef7f496d809ce59f263bc5 (diff)
downloadsrc-vendor/lldb.tar.gz
src-vendor/lldb.zip
Vendor import of stripped lldb trunk r375505, the last commit before thevendor/lldb/lldb-trunk-r375505vendor/lldb
upstream Subversion repository was made read-only, and the LLVM project migrated to GitHub: https://llvm.org/svn/llvm-project/lldb/trunk@375505
Notes
Notes: svn path=/vendor/lldb/dist/; revision=353952 svn path=/vendor/lldb/lldb-r375505/; revision=353953; tag=vendor/lldb/lldb-trunk-r375505
Diffstat (limited to 'source/Symbol/UnwindTable.cpp')
-rw-r--r--source/Symbol/UnwindTable.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/source/Symbol/UnwindTable.cpp b/source/Symbol/UnwindTable.cpp
index a8f451dc4643..045957a67b3b 100644
--- a/source/Symbol/UnwindTable.cpp
+++ b/source/Symbol/UnwindTable.cpp
@@ -13,6 +13,7 @@
#include "lldb/Core/Module.h"
#include "lldb/Core/Section.h"
#include "lldb/Symbol/ArmUnwindInfo.h"
+#include "lldb/Symbol/CallFrameInfo.h"
#include "lldb/Symbol/CompactUnwindInfo.h"
#include "lldb/Symbol/DWARFCallFrameInfo.h"
#include "lldb/Symbol/FuncUnwinders.h"
@@ -29,7 +30,8 @@ using namespace lldb_private;
UnwindTable::UnwindTable(Module &module)
: m_module(module), m_unwinds(), m_initialized(false), m_mutex(),
- m_eh_frame_up(), m_compact_unwind_up(), m_arm_unwind_up() {}
+ m_object_file_unwind_up(), m_eh_frame_up(), m_compact_unwind_up(),
+ m_arm_unwind_up() {}
// We can't do some of this initialization when the ObjectFile is running its
// ctor; delay doing it until needed for something.
@@ -47,6 +49,8 @@ void UnwindTable::Initialize() {
if (!object_file)
return;
+ m_object_file_unwind_up = object_file->CreateCallFrameInfo();
+
SectionList *sl = m_module.GetSectionList();
if (!sl)
return;
@@ -83,7 +87,12 @@ llvm::Optional<AddressRange> UnwindTable::GetAddressRange(const Address &addr,
SymbolContext &sc) {
AddressRange range;
- // First check the symbol context
+ // First check the unwind info from the object file plugin
+ if (m_object_file_unwind_up &&
+ m_object_file_unwind_up->GetAddressRange(addr, range))
+ return range;
+
+ // Check the symbol context
if (sc.GetAddressRange(eSymbolContextFunction | eSymbolContextSymbol, 0,
false, range) &&
range.GetBaseAddress().IsValid())
@@ -162,6 +171,11 @@ void UnwindTable::Dump(Stream &s) {
s.EOL();
}
+lldb_private::CallFrameInfo *UnwindTable::GetObjectFileUnwindInfo() {
+ Initialize();
+ return m_object_file_unwind_up.get();
+}
+
DWARFCallFrameInfo *UnwindTable::GetEHFrameInfo() {
Initialize();
return m_eh_frame_up.get();
@@ -182,11 +196,7 @@ ArmUnwindInfo *UnwindTable::GetArmUnwindInfo() {
return m_arm_unwind_up.get();
}
-SymbolFile *UnwindTable::GetSymbolFile() {
- if (SymbolVendor *vendor = m_module.GetSymbolVendor())
- return vendor->GetSymbolFile();
- return nullptr;
-}
+SymbolFile *UnwindTable::GetSymbolFile() { return m_module.GetSymbolFile(); }
ArchSpec UnwindTable::GetArchitecture() { return m_module.GetArchitecture(); }