diff options
Diffstat (limited to 'contrib/llvm-project/lldb/source/Symbol/UnwindTable.cpp')
-rw-r--r-- | contrib/llvm-project/lldb/source/Symbol/UnwindTable.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/contrib/llvm-project/lldb/source/Symbol/UnwindTable.cpp b/contrib/llvm-project/lldb/source/Symbol/UnwindTable.cpp index a8f451dc4643..045957a67b3b 100644 --- a/contrib/llvm-project/lldb/source/Symbol/UnwindTable.cpp +++ b/contrib/llvm-project/lldb/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(); } |