Improve error handling for `frame select` command when there are too many arguments.

Bug:  https://llvm.org/bugs/show_bug.cgi?id=25847

It now gives a more specific error message and then returns instead of trying to select the wrong frame.

llvm-svn: 256251
This commit is contained in:
Adrian McCarthy 2015-12-22 16:50:28 +00:00
parent 1ca9cda583
commit c2961ab889
2 changed files with 4 additions and 1 deletions

View File

@ -29,6 +29,7 @@ class CommonShortSpellingsTestCase(TestBase):
('dis', 'disassemble'),
('ta st a', 'target stop-hook add'),
('fr v', 'frame variable'),
('f 1', 'frame select 1'),
('ta st li', 'target stop-hook list'),
]

View File

@ -262,8 +262,10 @@ protected:
}
else
{
result.AppendError ("invalid arguments.\n");
result.AppendErrorWithFormat ("too many arguments; expected frame-index, saw '%s'.\n",
command.GetArgumentAtIndex(0));
m_options.GenerateOptionUsage (result.GetErrorStream(), this);
return false;
}
}