Handle the case where no eh_frame section is present.
RegisterContextLLDB holds a reference to the SymbolContext
in the vector of Cursors that UnwindLLDB maintains. Switch
UnwindLLDB to hold a vector of shared pointers of Cursors
so this reference doesn't become invalid.
Correctly falling back from the "fast" UnwindPlan to the
"full" UnwindPlan when additional registers need to be
retrieved.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118218 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Symbol/UnwindTable.cpp b/source/Symbol/UnwindTable.cpp
index 183e231..7738cba 100644
--- a/source/Symbol/UnwindTable.cpp
+++ b/source/Symbol/UnwindTable.cpp
@@ -77,6 +77,11 @@
initialize();
+ if (m_eh_frame == NULL)
+ {
+ return no_unwind_found;
+ }
+
// Create a FuncUnwinders object for the binary search below
AddressRange search_range(addr, 1);
FuncUnwindersSP search_unwind(new FuncUnwinders (*this, NULL, search_range));
@@ -103,26 +108,19 @@
}
AddressRange range;
- if (sc.GetAddressRange(eSymbolContextFunction | eSymbolContextSymbol, range))
+ if (!sc.GetAddressRange(eSymbolContextFunction | eSymbolContextSymbol, range) || !range.GetBaseAddress().IsValid())
{
- FuncUnwindersSP unw(new FuncUnwinders(*this, m_assembly_profiler, range));
- m_unwinds.push_back (unw);
- std::sort (m_unwinds.begin(), m_unwinds.end());
- return unw;
- }
- else
- {
- // Does the eh_frame unwind info has a function bounds defined for this addr?
- if (m_eh_frame->GetAddressRange (addr, range))
+ // Does the eh_frame unwind info has a function bounds for this addr?
+ if (!m_eh_frame->GetAddressRange (addr, range))
{
- FuncUnwindersSP unw(new FuncUnwinders(*this, m_assembly_profiler, range));
- m_unwinds.push_back (unw);
- std::sort (m_unwinds.begin(), m_unwinds.end());
- return unw;
- // FIXME we should create a syntheic Symbol based on the address range with a synthesized symbol name
+ return no_unwind_found;
}
}
- return no_unwind_found;
+
+ FuncUnwindersSP unw(new FuncUnwinders(*this, m_assembly_profiler, range));
+ m_unwinds.push_back (unw);
+ std::sort (m_unwinds.begin(), m_unwinds.end());
+ return unw;
}
DWARFCallFrameInfo *