Skip to content

[lldb] Inconsistent Order of messages in process launch behaviour #68035

Closed
@junior-jl

Description

@junior-jl

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions