Print port number that lldb-server binds to in platform mode
If binding to port 0 is selected, the actual port is printed.
This improves the reliability of platform startup by ensuring that
a free port can be found.
TEST PLAN
./lldb-server platform --listen *:0
Listening for a connection from <port-number>...
Will appear on stdout (with other stuff potentially)
llvm-svn: 238173
diff --git a/lldb/tools/lldb-server/lldb-platform.cpp b/lldb/tools/lldb-server/lldb-platform.cpp
index 54c219a..6f5dfbc 100644
--- a/lldb/tools/lldb-server/lldb-platform.cpp
+++ b/lldb/tools/lldb-server/lldb-platform.cpp
@@ -253,7 +253,6 @@
std::unique_ptr<Socket> listening_socket_up;
Socket *socket = nullptr;
- printf ("Listening for a connection from %s...\n", listen_host_port.c_str());
const bool children_inherit_listen_socket = false;
// the test suite makes many connections in parallel, let's not miss any.
@@ -267,6 +266,7 @@
exit(socket_error);
}
listening_socket_up.reset(socket);
+ printf ("Listening for a connection from %u...\n", listening_socket_up->GetLocalPortNumber());
do {
GDBRemoteCommunicationServerPlatform platform;