[Lldb-commits] [lldb] r138543 - /lldb/trunk/source/Commands/CommandObjectRegister.cpp

Jason Molenda jmolenda at apple.com
Wed Aug 24 18:59:13 PDT 2011


Author: jmolenda
Date: Wed Aug 24 20:59:13 2011
New Revision: 138543

URL: http://llvm.org/viewvc/llvm-project?rev=138543&view=rev
Log:
Emit an error message if we're unable to write a value to a register.
(in addition to the previous error message if the value could not be 
parsed as a numbe).  These both generate reasonable errors now -
reg write rip 0x500000000000000000000a
reg write rip 0x5jjjj

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

Modified: lldb/trunk/source/Commands/CommandObjectRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectRegister.cpp?rev=138543&r1=138542&r2=138543&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectRegister.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectRegister.cpp Wed Aug 24 20:59:13 2011
@@ -420,14 +420,20 @@
                             return true;
                         }
                     }
-                    else
+                    if (error.AsCString())
                     {
                         result.AppendErrorWithFormat ("Failed to write register '%s' with value '%s': %s\n",
                                                      reg_name,
                                                      value_str,
                                                      error.AsCString());
-                        result.SetStatus (eReturnStatusFailed);
                     }
+                    else
+                    {
+                        result.AppendErrorWithFormat ("Failed to write register '%s' with value '%s'",
+                                                     reg_name,
+                                                     value_str);
+                    }
+                    result.SetStatus (eReturnStatusFailed);
                 }
                 else
                 {





More information about the lldb-commits mailing list