diff options
| author | Greg Clayton <gclayton@apple.com> | 2016-07-12 23:07:50 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2016-07-12 23:07:50 +0000 |
| commit | d28fae834af6a9c841194f99409bd2a7a15c64cc (patch) | |
| tree | 5d16065b3218d6a73301c349bff536c42d4a505a | |
| parent | f1d93ecc760eb429ebe274399cbb0ab63691c336 (diff) | |
| download | bcm5719-llvm-d28fae834af6a9c841194f99409bd2a7a15c64cc.tar.gz bcm5719-llvm-d28fae834af6a9c841194f99409bd2a7a15c64cc.zip | |
Remove assert since it was crashing the mutli process driver tests. Made the code behave correctly when indexes are out of range or the collection is empty and is "log enable lldb unwind" is enabled, log an error message.
llvm-svn: 275226
| -rw-r--r-- | lldb/source/Symbol/UnwindPlan.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/lldb/source/Symbol/UnwindPlan.cpp b/lldb/source/Symbol/UnwindPlan.cpp index 30da44ad0aa..18f0cb7b9db 100644 --- a/lldb/source/Symbol/UnwindPlan.cpp +++ b/lldb/source/Symbol/UnwindPlan.cpp @@ -385,16 +385,27 @@ UnwindPlan::IsValidRowIndex (uint32_t idx) const const UnwindPlan::RowSP UnwindPlan::GetRowAtIndex (uint32_t idx) const { - // You must call IsValidRowIndex(idx) first before calling this!!! - assert (idx < m_row_list.size()); - return m_row_list[idx]; + if (idx < m_row_list.size()) + return m_row_list[idx]; + else + { + Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND)); + if (log) + log->Printf ("error: UnwindPlan::GetRowAtIndex(idx = %u) invalid index (number rows is %u)", idx, (uint32_t)m_row_list.size()); + return UnwindPlan::RowSP(); + } } const UnwindPlan::RowSP UnwindPlan::GetLastRow () const { - // You must call GetRowCount() first to make sure there is at least one row - assert (!m_row_list.empty()); + if (m_row_list.empty()) + { + Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND)); + if (log) + log->Printf ("UnwindPlan::GetLastRow() when rows are empty"); + return UnwindPlan::RowSP(); + } return m_row_list.back(); } |

