Fix thinko in UnwindTable.cpp where it wouldn't provde a

FuncUnwinders object if the eh_frame section was missing
from an objfile.  Worked fine on x86_64 but on i386 where
eh_frame is unusual, that resulted in the arch default 
UnwindPlan being used all the time instead of picking up
an assembly profile based unwindplan.

llvm-svn: 118467
This commit is contained in:
Jason Molenda 2010-11-09 01:21:22 +00:00
parent 478382521e
commit 45b4924550
4 changed files with 11 additions and 10 deletions

View File

@ -61,8 +61,8 @@ public:
return m_range.ContainsFileAddress (addr);
}
protected:
private:
UnwindTable& m_unwind_table;
UnwindAssemblyProfiler *m_assembly_profiler;
AddressRange m_range;

View File

@ -764,9 +764,14 @@ RegisterContextLLDB::SavedLocationForRegister (uint32_t lldb_regnum, RegisterLoc
{
if (log)
{
log->Printf("%*sFrame %d could not convert lldb regnum %d into %d RegisterKind reg numbering scheme",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_regnum, (int) unwindplan_registerkind);
if (unwindplan_registerkind == eRegisterKindGeneric)
log->Printf("%*sFrame %d could not convert lldb regnum %d into eRegisterKindGeneric reg numbering scheme",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_regnum);
else
log->Printf("%*sFrame %d could not convert lldb regnum %d into %d RegisterKind reg numbering scheme",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_regnum, (int) unwindplan_registerkind);
}
return false;
}

View File

@ -56,6 +56,7 @@ private:
lldb::RegisterContextSP reg_ctx; // These are all RegisterContextLLDB's
Cursor () : start_pc (LLDB_INVALID_ADDRESS), cfa (LLDB_INVALID_ADDRESS), sctx(), reg_ctx() { }
private:
DISALLOW_COPY_AND_ASSIGN (Cursor);
};

View File

@ -77,11 +77,6 @@ UnwindTable::GetFuncUnwindersContainingAddress (const Address& addr, SymbolConte
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));
@ -111,7 +106,7 @@ UnwindTable::GetFuncUnwindersContainingAddress (const Address& addr, SymbolConte
if (!sc.GetAddressRange(eSymbolContextFunction | eSymbolContextSymbol, range) || !range.GetBaseAddress().IsValid())
{
// Does the eh_frame unwind info has a function bounds for this addr?
if (!m_eh_frame->GetAddressRange (addr, range))
if (m_eh_frame == NULL || !m_eh_frame->GetAddressRange (addr, range))
{
return no_unwind_found;
}