diff options
author | Jim Ingham <jingham@apple.com> | 2011-09-08 01:15:09 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2011-09-08 01:15:09 +0000 |
commit | 213b454698ed53fc00203d0ea7be34f46dd0858d (patch) | |
tree | 3388a0cf34198e674ca59d8478bbe11126c1f687 /lldb/source/Commands/CommandObjectFrame.cpp | |
parent | 3343da542484ab1205caed70752b5ccb22711708 (diff) | |
download | llvm-213b454698ed53fc00203d0ea7be34f46dd0858d.zip llvm-213b454698ed53fc00203d0ea7be34f46dd0858d.tar.gz llvm-213b454698ed53fc00203d0ea7be34f46dd0858d.tar.bz2 |
"frame select -r" should return an error if you are already at the top of the stack & try to go up or at the bottom and try to go down.
llvm-svn: 139273
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectFrame.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 5b5d6c3..38522453 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -205,14 +205,34 @@ public: if (frame_idx >= -m_options.relative_frame_offset) frame_idx += m_options.relative_frame_offset; else - frame_idx = 0; + { + if (frame_idx == 0) + { + //If you are already at the bottom of the stack, then just warn and don't reset the frame. + result.AppendError("Already at the bottom of the stack"); + result.SetStatus(eReturnStatusFailed); + return false; + } + else + frame_idx = 0; + } } else if (m_options.relative_frame_offset > 0) { if (num_frames - frame_idx > m_options.relative_frame_offset) frame_idx += m_options.relative_frame_offset; else - frame_idx = num_frames - 1; + { + if (frame_idx == num_frames - 1) + { + //If we are already at the top of the stack, just warn and don't reset the frame. + result.AppendError("Already at the top of the stack"); + result.SetStatus(eReturnStatusFailed); + return false; + } + else + frame_idx = num_frames - 1; + } } } else |