[Lldb-commits] [lldb] r216766 - lldb - fix misleading "valid target indexes are" error message

Todd Fiala todd.fiala at gmail.com
Fri Aug 29 13:14:21 PDT 2014


Author: tfiala
Date: Fri Aug 29 15:14:21 2014
New Revision: 216766

URL: http://llvm.org/viewvc/llvm-project?rev=216766&view=rev
Log:
lldb - fix misleading "valid target indexes are" error message

See http://reviews.llvm.org/D4430 for more details.

Change by Paul Osmialowski.

Modified:
    lldb/trunk/source/Commands/CommandObjectTarget.cpp

Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=216766&r1=216765&r2=216766&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Fri Aug 29 15:14:21 2014
@@ -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);
                 }
             }





More information about the lldb-commits mailing list