-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[lldb] Inconsistent Order of messages in process launch
behaviour
#68035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-lldb
**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: The "Process X launched" message is displayed after the "Process X stopped" message. This does not happen if the commands are passed in the Example:
Expected output:
Related Context:
|
While debugging two sessions of
if (process_sp) {
...
llvm::StringRef data = stream.GetString();
if (!data.empty())
result.AppendMessage(data);
...
result.SetStatus(eReturnStatusSuccessFinishResult);
... By moving if (!data.empty())
result.AppendMessage(data); to the point before
I actually realized this some time ago, but there was another problem I was trying to tackle:
I'm not sure if this is expected. The execution of both cases diverge in if (synchronous_execution)
...
m_process_sp->ResumeSynchronous(stream);
else
error = m_process_sp->Resume(); The non-interactive execution has I must admit, I found this section of the source code a bit challenging to fully comprehend. Any insights? |
Fixes [#68035](#68035), where an inconsistency in the order of "Process launched" and "Process stopped" messages occurs during `process launch`. The fix involves adjusting the message output sequence in `CommandObjectProcessLaunch::DoExecute` within `source/Commands/CommandObjectProcess.cpp`. This ensures "Process launched" consistently precedes "Process stopped" when executing commands with the '-o' flag, i.e., non-interactive mode. 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 were expected as they relied on the previous, now-corrected message order. Updating these tests to align with the new message sequence is part of this PR's scope.
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:
Expected output:
Related Context:
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.The text was updated successfully, but these errors were encountered: