jafl created this revision.
jafl added a project: LLDB.

In CommandObjectRegisterRead.DoExecute(), set the status to "success" when 
appropriate.


Repository:
  rL LLVM

https://reviews.llvm.org/D32366

Files:
  source/Commands/CommandObjectRegister.cpp


Index: source/Commands/CommandObjectRegister.cpp
===================================================================
--- source/Commands/CommandObjectRegister.cpp
+++ source/Commands/CommandObjectRegister.cpp
@@ -176,7 +176,9 @@
           set_idx = 
m_command_options.set_indexes[i]->GetUInt64Value(UINT32_MAX,
                                                                      nullptr);
           if (set_idx < reg_ctx->GetRegisterSetCount()) {
-            if (!DumpRegisterSet(m_exe_ctx, strm, reg_ctx, set_idx)) {
+            if (DumpRegisterSet(m_exe_ctx, strm, reg_ctx, set_idx)) {
+              result.SetStatus(eReturnStatusSuccessFinishResult);
+            } else {
               if (errno)
                 result.AppendErrorWithFormat("register read failed: %s\n",
                                              strerror(errno));
@@ -201,6 +203,7 @@
           // registers.
           DumpRegisterSet(m_exe_ctx, strm, reg_ctx, set_idx,
                           !m_command_options.dump_all_sets.GetCurrentValue());
+          result.SetStatus(eReturnStatusSuccessFinishResult);
         }
       }
     } else {
@@ -225,7 +228,9 @@
           reg_info = reg_ctx->GetRegisterInfoByName(arg_str);
 
           if (reg_info) {
-            if (!DumpRegister(m_exe_ctx, strm, reg_ctx, reg_info))
+            if (DumpRegister(m_exe_ctx, strm, reg_ctx, reg_info))
+              result.SetStatus(eReturnStatusSuccessFinishResult);
+            else
               strm.Printf("%-12s = error: unavailable\n", reg_info->name);
           } else {
             result.AppendErrorWithFormat("Invalid register name '%s'.\n",


Index: source/Commands/CommandObjectRegister.cpp
===================================================================
--- source/Commands/CommandObjectRegister.cpp
+++ source/Commands/CommandObjectRegister.cpp
@@ -176,7 +176,9 @@
           set_idx = m_command_options.set_indexes[i]->GetUInt64Value(UINT32_MAX,
                                                                      nullptr);
           if (set_idx < reg_ctx->GetRegisterSetCount()) {
-            if (!DumpRegisterSet(m_exe_ctx, strm, reg_ctx, set_idx)) {
+            if (DumpRegisterSet(m_exe_ctx, strm, reg_ctx, set_idx)) {
+              result.SetStatus(eReturnStatusSuccessFinishResult);
+            } else {
               if (errno)
                 result.AppendErrorWithFormat("register read failed: %s\n",
                                              strerror(errno));
@@ -201,6 +203,7 @@
           // registers.
           DumpRegisterSet(m_exe_ctx, strm, reg_ctx, set_idx,
                           !m_command_options.dump_all_sets.GetCurrentValue());
+          result.SetStatus(eReturnStatusSuccessFinishResult);
         }
       }
     } else {
@@ -225,7 +228,9 @@
           reg_info = reg_ctx->GetRegisterInfoByName(arg_str);
 
           if (reg_info) {
-            if (!DumpRegister(m_exe_ctx, strm, reg_ctx, reg_info))
+            if (DumpRegister(m_exe_ctx, strm, reg_ctx, reg_info))
+              result.SetStatus(eReturnStatusSuccessFinishResult);
+            else
               strm.Printf("%-12s = error: unavailable\n", reg_info->name);
           } else {
             result.AppendErrorWithFormat("Invalid register name '%s'.\n",
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to