"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
This commit is contained in:
Jim Ingham 2011-09-08 01:15:09 +00:00
parent 3343da5424
commit 213b454698
1 changed files with 22 additions and 2 deletions

View File

@ -204,17 +204,37 @@ public:
{
if (frame_idx >= -m_options.relative_frame_offset)
frame_idx += m_options.relative_frame_offset;
else
{
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
{
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
{
if (command.GetArgumentCount() == 1)