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
This commit is contained in:
Todd Fiala 2014-08-29 20:14:21 +00:00
parent 53dd8fea69
commit 352237dbb6
1 changed files with 10 additions and 3 deletions

View File

@ -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);
}
}