<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/68035>68035</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[lldb] Inconsistent Order of messages in `process launch` behaviour
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
junior-jl
</td>
</tr>
</table>
<pre>
**Issue Description:**
When using the `process launch` command in LLDB with a previously created breakpoint, there is an inconsistency in the order of messages displayed in the debugger prompt. Depending on how the command is executed, the "Process launched" message may appear either before or after the "Process stopped" message.
**Steps to Reproduce:**
Execute LLDB with the following command: `$ path/to/llvm-project/bin/lldb /path/to/executable -o "b main" -o "r"`
The "Process X launched" message is displayed after the "Process X stopped" message.
This does not happen if the commands are passed in the `(lldb)` prompts.
**Example:**
```
$ ./bin/lldb ~/main.out -o 'b main' -o 'r'
(lldb) target create "/home/jose/main.out"
Current executable set to '/home/jose/main.out' (x86_64).
(lldb) b main
Breakpoint 1: where = main.out`main + 15 at main.c:2:21, address = 0x000000000000114f
(lldb) r
Process 67805 stopped
* thread #1, name = 'main.out', stop reason = breakpoint 1.1
frame #0: 0x000055555555514f main.out`main at main.c:2:21
1 int foo() { return 0; }
-> 2 int main() { return foo(); }
3
Process 67805 launched: '/home/jose/main.out' (x86_64)
(lldb)
```
**Expected output:**
```
$ ./bin/lldb ~/main.out
(lldb) target create "/home/jose/main.out"
Current executable set to '/home/jose/main.out' (x86_64).
(lldb) b main
Breakpoint 1: where = main.out`main + 15 at main.c:2:21, address = 0x000000000000114f
(lldb) r
Process 67920 launched: '/home/jose/main.out' (x86_64)
Process 67920 stopped
* thread #1, name = 'main.out', stop reason = breakpoint 1.1
frame #0: 0x000055555555514f main.out`main at main.c:2:21
1 int foo() { return 0; }
-> 2 int main() { return foo(); }
3
```
**Related Context:**
- This issue was discussed in a [related PR](https://github.com/llvm/llvm-project/pull/67019), which implements an option to `process launch` that launches the process and pauses execution in the entry point of the program, and it was suggested that this behavior should be addressed separately.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsVk1v4zYQ_TX0ZRBDoqwPH3yI4zWwwAJdbBfo3gpKHFtMJZIgqXV86W8vhpISO3G3CNoeCtRIDEvkDOe9mccZ4b06asQNy7cs3y3EEFrjNo-DVsbdPXaL2sjzhvF7xu8_ej8g7NA3TtmgjGbZ_bjCkh1L7n9pUcPglT5CaBFYkVhnGvQeOjHopmVFAo3pe6ElKA2fPu22cFKhBQHW4XdlBt-doXEoAkqoHYrfrFE6MP5ADh2C8iA0KN0Y7ZUPqJszeaLTjJPowBygR-_FET1I5W0nzijnLRLr4XhEB9aZ3oYl7NCilhSv0dCaU9z1HKEHfMJmCCinAIBx_vkKES3x-UToxRmEtSgcoKKAocaDcRQbiENA99qJD8baKx_LkcnpO3L7c0DrIRj4gtYZOTT4ivYPY5QXfNIxB9N15kTYJkAsu6eUML4CK0LL-D4Yxvdd972_s848YhMY39dKx5eyBsb3lxtHMkTdIdwZQlFDL2g3n54d45wOuEDw9Rrvt5u0qctU3eTp218x9bUlJwY9aBOgpSRoUIfLfHoQDsEK718KItJREVjG11SdY2H4G1n48CR6272mfvoukulvMljB8prK3xnfE1lLM4SRrXJmr5yeHePlbD-HBEG4I4ZJEsQI4_vW9Mj4_tF4vPBKa9H6YXAOdYCLdHkMVD90wJ-bl8B49VQVvxYrxtfLN6FM8cbX22dpQkpldYriZNkOnv0VCf0ExreQ5iDCuNKw7J7Tf0qSElI6Si8ZJk_JxSdNV4c3EbjxzVwURVkl-XNhzKmC0DoUEhjP4hla9GNkjJcXYGmJTMGh8EbHHfUFqmU6eoSDiw54lhDQMcp8_qSrwxvEN6COngBSAGDJmg44GMN4RahYuQWHYXAaEpZtgZW70eCOZR-Av5iM5fLa5tnRlS1kt7h6Fh_dBO8ohjeZ-FHxX2nGYkNXuRmCHcI_oJ3_BfIugax58jeTfu3r3xYbwH9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