aboutsummaryrefslogtreecommitdiff
path: root/source/Symbol/UnwindPlan.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Symbol/UnwindPlan.cpp')
-rw-r--r--source/Symbol/UnwindPlan.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/source/Symbol/UnwindPlan.cpp b/source/Symbol/UnwindPlan.cpp
index 7b361e7d2eb9..ff0468e314d8 100644
--- a/source/Symbol/UnwindPlan.cpp
+++ b/source/Symbol/UnwindPlan.cpp
@@ -126,7 +126,7 @@ UnwindPlan::Row::RegisterLocation::Dump (Stream &s, const UnwindPlan* unwind_pla
case inOtherRegister:
{
- const RegisterInfo *other_reg_info = NULL;
+ const RegisterInfo *other_reg_info = nullptr;
if (unwind_plan)
other_reg_info = unwind_plan->GetRegisterInfo (thread, m_location.reg_num);
if (other_reg_info)
@@ -313,6 +313,19 @@ UnwindPlan::AppendRow (const UnwindPlan::RowSP &row_sp)
m_row_list.back() = row_sp;
}
+void
+UnwindPlan::InsertRow (const UnwindPlan::RowSP &row_sp)
+{
+ collection::iterator it = m_row_list.begin();
+ while (it != m_row_list.end()) {
+ RowSP row = *it;
+ if (row->GetOffset() > row_sp->GetOffset())
+ break;
+ it++;
+ }
+ m_row_list.insert(it, row_sp);
+}
+
UnwindPlan::RowSP
UnwindPlan::GetRowForFunctionOffset (int offset) const
{
@@ -326,7 +339,7 @@ UnwindPlan::GetRowForFunctionOffset (int offset) const
collection::const_iterator pos, end = m_row_list.end();
for (pos = m_row_list.begin(); pos != end; ++pos)
{
- if ((*pos)->GetOffset() <= offset)
+ if ((*pos)->GetOffset() <= static_cast<lldb::offset_t>(offset))
row = *pos;
else
break;
@@ -381,7 +394,7 @@ UnwindPlan::PlanValidAtAddress (Address addr)
if (log)
{
StreamString s;
- if (addr.Dump (&s, NULL, Address::DumpStyleSectionNameOffset))
+ if (addr.Dump (&s, nullptr, Address::DumpStyleSectionNameOffset))
{
log->Printf ("UnwindPlan is invalid -- no unwind rows for UnwindPlan '%s' at address %s",
m_source_name.GetCString(), s.GetData());
@@ -397,13 +410,13 @@ UnwindPlan::PlanValidAtAddress (Address addr)
// If the 0th Row of unwind instructions is missing, or if it doesn't provide
// a register to use to find the Canonical Frame Address, this is not a valid UnwindPlan.
- if (GetRowAtIndex(0).get() == NULL || GetRowAtIndex(0)->GetCFARegister() == LLDB_INVALID_REGNUM)
+ if (GetRowAtIndex(0).get() == nullptr || GetRowAtIndex(0)->GetCFARegister() == LLDB_INVALID_REGNUM)
{
Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND));
if (log)
{
StreamString s;
- if (addr.Dump (&s, NULL, Address::DumpStyleSectionNameOffset))
+ if (addr.Dump (&s, nullptr, Address::DumpStyleSectionNameOffset))
{
log->Printf ("UnwindPlan is invalid -- no CFA register defined in row 0 for UnwindPlan '%s' at address %s",
m_source_name.GetCString(), s.GetData());
@@ -480,6 +493,6 @@ UnwindPlan::GetRegisterInfo (Thread* thread, uint32_t unwind_reg) const
return reg_ctx->GetRegisterInfoAtIndex (reg);
}
}
- return NULL;
+ return nullptr;
}