[Lldb-commits] [lldb] [lldb] Add missing calls to SetStatus in CommandObjectPlatform (PR #197548)

via lldb-commits lldb-commits at lists.llvm.org
Wed May 13 12:54:26 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

<details>
<summary>Changes</summary>

Add missing calls to CommandReturnObject::SetStatus in CommandObjectPlatform. I replaced some calls to AppendMessageWithFormatv with AppendErrorWithFormatv because the latter implicitly sets the status.

---
Full diff: https://github.com/llvm/llvm-project/pull/197548.diff


1 Files Affected:

- (modified) lldb/source/Commands/CommandObjectPlatform.cpp (+10-4) 


``````````diff
diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp
index 52b571acd13ee..178717acb0d38 100644
--- a/lldb/source/Commands/CommandObjectPlatform.cpp
+++ b/lldb/source/Commands/CommandObjectPlatform.cpp
@@ -394,6 +394,7 @@ class CommandObjectPlatformSettings : public CommandObjectParsed {
       if (m_option_working_dir.GetOptionValue().OptionWasSet())
         platform_sp->SetWorkingDirectory(
             m_option_working_dir.GetOptionValue().GetCurrentValue());
+      result.SetStatus(eReturnStatusSuccessFinishResult);
     } else {
       result.AppendError("no platform is currently selected");
     }
@@ -833,8 +834,8 @@ class CommandObjectPlatformGetFile : public CommandObjectParsed {
             remote_file_path, local_file_path);
         result.SetStatus(eReturnStatusSuccessFinishResult);
       } else {
-        result.AppendMessageWithFormatv("get-file failed: {0}",
-                                        error.AsCString());
+        result.AppendErrorWithFormatv("get-file failed: {0}",
+                                      error.AsCString());
       }
     } else {
       result.AppendError("no platform currently selected\n");
@@ -879,8 +880,8 @@ class CommandObjectPlatformGetSize : public CommandObjectParsed {
                                         remote_file_path.c_str(), size);
         result.SetStatus(eReturnStatusSuccessFinishResult);
       } else {
-        result.AppendMessageWithFormatv(
-            "Error getting file size of {0} (remote)",
+        result.AppendErrorWithFormatv(
+            "failed to get file size of {0} (remote)",
             remote_file_path.c_str());
       }
     } else {
@@ -1152,6 +1153,7 @@ class CommandObjectPlatformProcessLaunch : public CommandObjectParsed {
         if (rebroadcast_first_stop) {
           assert(first_stop_event_sp);
           process_sp->BroadcastEvent(first_stop_event_sp);
+          result.SetStatus(eReturnStatusSuccessFinishNoResult);
           return;
         }
 
@@ -1184,6 +1186,8 @@ class CommandObjectPlatformProcessLaunch : public CommandObjectParsed {
           result.SetStatus(eReturnStatusSuccessFinishNoResult);
           return;
         }
+        if (result.GetStatus() != eReturnStatusFailed)
+          result.SetStatus(eReturnStatusSuccessFinishNoResult);
       } else {
         result.AppendError("'platform process launch' uses the current target "
                            "file and arguments, or the executable and its "
@@ -1503,6 +1507,8 @@ class CommandObjectPlatformProcessInfo : public CommandObjectParsed {
               ostrm.EOL();
             }
           }
+          if (result.GetStatus() != eReturnStatusFailed)
+            result.SetStatus(eReturnStatusSuccessFinishResult);
         } else {
           // Not connected...
           result.AppendErrorWithFormatv("not connected to '{0}'",

``````````

</details>


https://github.com/llvm/llvm-project/pull/197548


More information about the lldb-commits mailing list