[Lldb-commits] [lldb] [lldb-server] Route info prints to the log channel (PR #205572)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Wed Jun 24 09:15:24 PDT 2026
DavidSpickett wrote:
These are not part of my [workflow](https://xkcd.com/1172/) in the strict sense, but I do find the `Connection established.` one useful when doing remote testing. I could enable the log channel but that does come with extra output:
```
$ ./bin/lldb-server g 127.0.0.1:1234 --log-channels "lldb host" -- $(which ls)
Launched '/usr/bin/ls' as process 596927...
lldb-server-local_build
Connection established.
1782317400.922612190 HostInfoLinux.cpp:operator() attempting to determine Linux distribution...
1782317400.947287321 HostInfoLinux.cpp:operator() distribution id command returned "Distributor ID: Ubuntu
"
1782317400.947312355 HostInfoLinux.cpp:operator() distribution id set to "ubuntu"
1782317400.975976229 HostInfoLinux.cpp:operator() distribution id command returned "Distributor ID: Ubuntu
"
1782317400.975996971 HostInfoLinux.cpp:operator() distribution id set to "ubuntu"
lldb-server exiting...
```
That said, the reason I look for that message is to know that something is happening. Enabling the host log is just a more detailed version of that and often would have been more useful to me.
I assume we were inspired by gdbserver, though we don't print the same information as they do:
```
$ gdbserver 127.0.0.1:1234 -- $(which ls)
Process -- created; pid = 596861
Listening on port 1234
```
So I'm not against making them log messages, but -
> When lldb-server is invoked as a child of the lldb client and stdout/stderr are piped together to FileCheck on Windows, asynchronous prints from lldb-server race against the client's output and break ordering-sensitive tests.
Can you explain why this is a problem on Windows but nowhere else? Is the printing synchronous on other platforms?
Please include an example of this mixed up output.
https://github.com/llvm/llvm-project/pull/205572
More information about the lldb-commits
mailing list