summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2013-11-05 18:25:23 +0000
committerJim Ingham <jingham@apple.com>2013-11-05 18:25:23 +0000
commitafbb0af827304aa72e86587c100c024da40012c9 (patch)
tree78af9f14efdfe2b1c6f48cce62592e6df615f541
parent34a7109b47ba2cdcf6c5b87cdf55f11987ff5975 (diff)
downloadbcm5719-llvm-afbb0af827304aa72e86587c100c024da40012c9.tar.gz
bcm5719-llvm-afbb0af827304aa72e86587c100c024da40012c9.zip
Give a better error when the index argument for “frame select” can’t be parsed.
<rdar://problem/15390829> llvm-svn: 194087
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index 2e852d0bb76..0ef97326150 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -245,7 +245,14 @@ protected:
if (command.GetArgumentCount() == 1)
{
const char *frame_idx_cstr = command.GetArgumentAtIndex(0);
- frame_idx = Args::StringToUInt32 (frame_idx_cstr, UINT32_MAX, 0);
+ bool success = false;
+ frame_idx = Args::StringToUInt32 (frame_idx_cstr, UINT32_MAX, 0, &success);
+ if (!success)
+ {
+ result.AppendErrorWithFormat ("invalid frame index argument '%s'", frame_idx_cstr);
+ result.SetStatus (eReturnStatusFailed);
+ return false;
+ }
}
else if (command.GetArgumentCount() == 0)
{
OpenPOWER on IntegriCloud