diff options
| author | Greg Clayton <gclayton@apple.com> | 2013-11-22 21:03:42 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2013-11-22 21:03:42 +0000 |
| commit | ec6829eac0ce5a86ca5399be54e5199d1cb01a51 (patch) | |
| tree | 92fd58beb1b6761aa897a2478128ad0a5d4116b0 /lldb/source/Target | |
| parent | 860934a9240309e18f92152e8eec130b5b46d8a0 (diff) | |
| download | bcm5719-llvm-ec6829eac0ce5a86ca5399be54e5199d1cb01a51.tar.gz bcm5719-llvm-ec6829eac0ce5a86ca5399be54e5199d1cb01a51.zip | |
Patch from Todd Fiala: lldb will seg fault if for some reason there is no unwinder when StackFrameList::GetFramesUpTo() is called.
Mainly patched to stop LLDB from crashing. This can easily happen if you debug to a remote gdbserver that doesn't have any dynamic register info and you don't have a target definition file specified.
llvm-svn: 195499
Diffstat (limited to 'lldb/source/Target')
| -rw-r--r-- | lldb/source/Target/StackFrameList.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp index eaac3613c93..631a77bd495 100644 --- a/lldb/source/Target/StackFrameList.cpp +++ b/lldb/source/Target/StackFrameList.cpp @@ -301,7 +301,7 @@ StackFrameList::GetFramesUpTo(uint32_t end_idx) if (reg_ctx_sp) { - const bool success = unwinder->GetFrameInfoAtIndex(idx, cfa, pc); + const bool success = unwinder && unwinder->GetFrameInfoAtIndex(idx, cfa, pc); // There shouldn't be any way not to get the frame info for frame 0. // But if the unwinder can't make one, lets make one by hand with the // SP as the CFA and see if that gets any further. @@ -329,7 +329,7 @@ StackFrameList::GetFramesUpTo(uint32_t end_idx) } else { - const bool success = unwinder->GetFrameInfoAtIndex(idx, cfa, pc); + const bool success = unwinder && unwinder->GetFrameInfoAtIndex(idx, cfa, pc); if (!success) { // We've gotten to the end of the stack. @@ -451,14 +451,17 @@ StackFrameList::GetFramesUpTo(uint32_t end_idx) { if (end_idx < m_concrete_frames_fetched) return; - - uint32_t num_frames = unwinder->GetFramesUpTo(end_idx); - if (num_frames <= end_idx + 1) + + if (unwinder) { - //Done unwinding. - m_concrete_frames_fetched = UINT32_MAX; + uint32_t num_frames = unwinder->GetFramesUpTo(end_idx); + if (num_frames <= end_idx + 1) + { + //Done unwinding. + m_concrete_frames_fetched = UINT32_MAX; + } + m_frames.resize(num_frames); } - m_frames.resize(num_frames); } } |

