summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2014-08-29 20:14:21 +0000
committerTodd Fiala <todd.fiala@gmail.com>2014-08-29 20:14:21 +0000
commit352237dbb6d17cbce5dd1a23d8c2e3c2c95d8106 (patch)
tree1d79180410afe7d331b9050848666d38dd819cfd /lldb/source/Commands
parent53dd8fea69bcae12c3aa1d120d1e31808a2ae6c5 (diff)
downloadbcm5719-llvm-352237dbb6d17cbce5dd1a23d8c2e3c2c95d8106.tar.gz
bcm5719-llvm-352237dbb6d17cbce5dd1a23d8c2e3c2c95d8106.zip
lldb - fix misleading "valid target indexes are" error message
See http://reviews.llvm.org/D4430 for more details. Change by Paul Osmialowski. llvm-svn: 216766
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 24a6b9dcadb..024f7b5a041 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -545,9 +545,16 @@ protected:
}
else
{
- result.AppendErrorWithFormat ("index %u is out of range, valid target indexes are 0 - %u\n",
- target_idx,
- num_targets - 1);
+ if (num_targets > 0)
+ {
+ result.AppendErrorWithFormat ("index %u is out of range, valid target indexes are 0 - %u\n",
+ target_idx,
+ num_targets - 1);
+ } else
+ {
+ result.AppendErrorWithFormat ("index %u is out of range since there are no active targets\n",
+ target_idx);
+ }
result.SetStatus (eReturnStatusFailed);
}
}
OpenPOWER on IntegriCloud