[Lldb-commits] [PATCH] D32366: Set "success" status correctly

John Lindal via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 21 11:52:10 PDT 2017


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",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32366.96194.patch
Type: text/x-patch
Size: 1635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170421/904bfb1d/attachment.bin>


More information about the lldb-commits mailing list