llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: José Lira Junior (junior-jl)

<details>
<summary>Changes</summary>

## Overview

This pull request addresses the issue [#<!-- 
-->68035](https://github.com/llvm/llvm-project/issues/68035), where an 
inconsistency in the order of "Process launched" and "Process stopped" messages 
occurs during `process launch`.

## Impact

Upon implementing this change, two tests failed: 
`lldb/test/Shell/Breakpoint/jit-loader_jitlink_elf.test` and 
`lldb/test/Shell/Breakpoint/jit-loader_rtdyld_elf.test`. These failures are 
anticipated as the tests are designed to expect the "Process stopped" message 
before the "Process launched" message, which is the behavior this PR aims to 
correct.

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


1 Files Affected:

- (modified) lldb/source/Commands/CommandObjectProcess.cpp (+2-2) 


``````````diff
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp 
b/lldb/source/Commands/CommandObjectProcess.cpp
index c7ce1b1258c196c..f601316a6f673ec 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -265,8 +265,6 @@ class CommandObjectProcessLaunch : public 
CommandObjectProcessLaunchOrAttach {
         process_sp->SyncIOHandler(0, std::chrono::seconds(2));
 
         llvm::StringRef data = stream.GetString();
-        if (!data.empty())
-          result.AppendMessage(data);
         // If we didn't have a local executable, then we wouldn't have had an
         // executable module before launch.
         if (!exe_module_sp)
@@ -282,6 +280,8 @@ class CommandObjectProcessLaunch : public 
CommandObjectProcessLaunchOrAttach {
               exe_module_sp->GetFileSpec().GetPath().c_str(), archname);
         }
         result.SetStatus(eReturnStatusSuccessFinishResult);
+        if (!data.empty())
+          result.AppendMessage(data);
         result.SetDidChangeProcessState(true);
       } else {
         result.AppendError(

``````````

</details>


https://github.com/llvm/llvm-project/pull/73173
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to