summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/Symbol/UnwindPlan.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Symbol/UnwindPlan.cpp')
-rw-r--r--contrib/llvm/tools/lldb/source/Symbol/UnwindPlan.cpp77
1 files changed, 72 insertions, 5 deletions
diff --git a/contrib/llvm/tools/lldb/source/Symbol/UnwindPlan.cpp b/contrib/llvm/tools/lldb/source/Symbol/UnwindPlan.cpp
index ff0468e..87d0f49 100644
--- a/contrib/llvm/tools/lldb/source/Symbol/UnwindPlan.cpp
+++ b/contrib/llvm/tools/lldb/source/Symbol/UnwindPlan.cpp
@@ -153,6 +153,7 @@ UnwindPlan::Row::RegisterLocation::Dump (Stream &s, const UnwindPlan* unwind_pla
void
UnwindPlan::Row::Clear ()
{
+ m_cfa_type = CFAIsRegisterPlusOffset;
m_offset = 0;
m_cfa_reg_num = LLDB_INVALID_REGNUM;
m_cfa_offset = 0;
@@ -167,7 +168,7 @@ UnwindPlan::Row::Dump (Stream& s, const UnwindPlan* unwind_plan, Thread* thread,
if (base_addr != LLDB_INVALID_ADDRESS)
s.Printf ("0x%16.16" PRIx64 ": CFA=", base_addr + GetOffset());
else
- s.Printf ("0x%8.8" PRIx64 ": CFA=", GetOffset());
+ s.Printf ("%4" PRId64 ": CFA=", GetOffset());
if (reg_info)
s.Printf ("%s", reg_info->name);
@@ -189,10 +190,11 @@ UnwindPlan::Row::Dump (Stream& s, const UnwindPlan* unwind_plan, Thread* thread,
}
UnwindPlan::Row::Row() :
- m_offset(0),
- m_cfa_reg_num(LLDB_INVALID_REGNUM),
- m_cfa_offset(0),
- m_register_locations()
+ m_offset (0),
+ m_cfa_type (CFAIsRegisterPlusOffset),
+ m_cfa_reg_num (LLDB_INVALID_REGNUM),
+ m_cfa_offset (0),
+ m_register_locations ()
{
}
@@ -209,6 +211,16 @@ UnwindPlan::Row::GetRegisterInfo (uint32_t reg_num, UnwindPlan::Row::RegisterLoc
}
void
+UnwindPlan::Row::RemoveRegisterInfo (uint32_t reg_num)
+{
+ collection::const_iterator pos = m_register_locations.find(reg_num);
+ if (pos != m_register_locations.end())
+ {
+ m_register_locations.erase(pos);
+ }
+}
+
+void
UnwindPlan::Row::SetRegisterInfo (uint32_t reg_num, const UnwindPlan::Row::RegisterLocation register_location)
{
m_register_locations[reg_num] = register_location;
@@ -301,6 +313,23 @@ UnwindPlan::Row::operator == (const UnwindPlan::Row& rhs) const
{
if (m_offset != rhs.m_offset || m_cfa_reg_num != rhs.m_cfa_reg_num || m_cfa_offset != rhs.m_cfa_offset)
return false;
+
+ if (m_cfa_type != rhs.m_cfa_type)
+ return false;
+
+ if (m_cfa_type == CFAIsRegisterPlusOffset)
+ {
+ if (m_cfa_reg_num != rhs.m_cfa_reg_num)
+ return false;
+ if (m_cfa_offset != rhs.m_cfa_offset)
+ return false;
+ }
+ if (m_cfa_type == CFAIsRegisterDereferenced)
+ {
+ if (m_cfa_reg_num != rhs.m_cfa_reg_num)
+ return false;
+ }
+
return m_register_locations == rhs.m_register_locations;
}
@@ -449,6 +478,44 @@ UnwindPlan::Dump (Stream& s, Thread *thread, lldb::addr_t base_addr) const
{
s.Printf ("This UnwindPlan originally sourced from %s\n", m_source_name.GetCString());
}
+ if (m_lsda_address.IsValid() && m_personality_func_addr.IsValid())
+ {
+ TargetSP target_sp(thread->CalculateTarget());
+ addr_t lsda_load_addr = m_lsda_address.GetLoadAddress (target_sp.get());
+ addr_t personality_func_load_addr = m_personality_func_addr.GetLoadAddress (target_sp.get());
+
+ if (lsda_load_addr != LLDB_INVALID_ADDRESS && personality_func_load_addr != LLDB_INVALID_ADDRESS)
+ {
+ s.Printf("LSDA address 0x%" PRIx64 ", personality routine is at address 0x%" PRIx64 "\n",
+ lsda_load_addr, personality_func_load_addr);
+ }
+ }
+ s.Printf ("This UnwindPlan is sourced from the compiler: ");
+ switch (m_plan_is_sourced_from_compiler)
+ {
+ case eLazyBoolYes:
+ s.Printf ("yes.\n");
+ break;
+ case eLazyBoolNo:
+ s.Printf ("no.\n");
+ break;
+ case eLazyBoolCalculate:
+ s.Printf ("not specified.\n");
+ break;
+ }
+ s.Printf ("This UnwindPlan is valid at all instruction locations: ");
+ switch (m_plan_is_valid_at_all_instruction_locations)
+ {
+ case eLazyBoolYes:
+ s.Printf ("yes.\n");
+ break;
+ case eLazyBoolNo:
+ s.Printf ("no.\n");
+ break;
+ case eLazyBoolCalculate:
+ s.Printf ("not specified.\n");
+ break;
+ }
if (m_plan_valid_address_range.GetBaseAddress().IsValid() && m_plan_valid_address_range.GetByteSize() > 0)
{
s.PutCString ("Address range of this UnwindPlan: ");
OpenPOWER on IntegriCloud