[Lldb-commits] [lldb] r155422 - /lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Jim Ingham jingham at apple.com
Mon Apr 23 19:25:07 PDT 2012


Author: jingham
Date: Mon Apr 23 21:25:07 2012
New Revision: 155422

URL: http://llvm.org/viewvc/llvm-project?rev=155422&view=rev
Log:
Report the command error when we are in "stop on error mode."

Modified:
    lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=155422&r1=155421&r2=155422&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Mon Apr 23 21:25:07 2012
@@ -2272,20 +2272,23 @@
                 
         if (!success || !tmp_result.Succeeded())
         {
+            const char *error_msg = tmp_result.GetErrorData();
+            if (error_msg == NULL || error_msg[0] == '\0')
+                error_msg = "<unknown error>.\n";
             if (stop_on_error)
             {
-                result.AppendErrorWithFormat("Aborting reading of commands after command #%d: '%s' failed.\n", 
-                                         idx, cmd);
+                result.AppendErrorWithFormat("Aborting reading of commands after command #%d: '%s' failed with %s",
+                                         idx, cmd, error_msg);
                 result.SetStatus (eReturnStatusFailed);
                 m_debugger.SetAsyncExecution (old_async_execution);
                 return;
             }
             else if (print_results)
             {
-                result.AppendMessageWithFormat ("Command #%d '%s' failed with error: %s.\n", 
+                result.AppendMessageWithFormat ("Command #%d '%s' failed with %s",
                                                 idx + 1, 
                                                 cmd, 
-                                                tmp_result.GetErrorData());
+                                                error_msg);
             }
         }
         





More information about the lldb-commits mailing list