diff options
author | Jim Ingham <jingham@apple.com> | 2012-02-29 03:40:22 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2012-02-29 03:40:22 +0000 |
commit | b0c72a5f584de8334f0af10e48ba687fc6e8ae70 (patch) | |
tree | 981c2805d85d318478a95bd27c4f54b8e4666a5a /lldb/source/Commands/CommandObjectFrame.cpp | |
parent | 7bc0ec3aad663a2c81fddf9da38dba46bba6be19 (diff) | |
download | llvm-b0c72a5f584de8334f0af10e48ba687fc6e8ae70.zip llvm-b0c72a5f584de8334f0af10e48ba687fc6e8ae70.tar.gz llvm-b0c72a5f584de8334f0af10e48ba687fc6e8ae70.tar.bz2 |
Make the StackFrameList::GetFrameAtIndex only fetch as many stack frames as needed to
get the frame requested.
<rdar://problem/10943135>
llvm-svn: 151705
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectFrame.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index c44a45b..409cb6d 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -196,7 +196,6 @@ public: Thread *thread = exe_ctx.GetThreadPtr(); if (thread) { - const uint32_t num_frames = thread->GetStackFrameCount(); uint32_t frame_idx = UINT32_MAX; if (m_options.relative_frame_offset != INT32_MIN) { @@ -224,6 +223,9 @@ public: } else if (m_options.relative_frame_offset > 0) { + // I don't want "up 20" where "20" takes you past the top of the stack to produce + // an error, but rather to just go to the top. So I have to count the stack here... + const uint32_t num_frames = thread->GetStackFrameCount(); if (num_frames - frame_idx > m_options.relative_frame_offset) frame_idx += m_options.relative_frame_offset; else @@ -262,9 +264,9 @@ public: } } - if (frame_idx < num_frames) + bool success = thread->SetSelectedFrameByIndex (frame_idx); + if (success) { - thread->SetSelectedFrameByIndex (frame_idx); exe_ctx.SetFrameSP(thread->GetSelectedFrame ()); StackFrame *frame = exe_ctx.GetFramePtr(); if (frame) |