Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -1078,7 +1078,7 @@ } else { // No host and port given, so lets listen on our end and make the // debugserver connect to us.. - error = StartListenThread("127.0.0.1", 0); + error = StartListenThread("localhost", 0); if (error.Fail()) { if (log) log->Printf("GDBRemoteCommunication::%s() unable to start listen " @@ -1093,7 +1093,7 @@ uint16_t port_ = connection->GetListeningPort(std::chrono::seconds(10)); if (port_ > 0) { char port_cstr[32]; - snprintf(port_cstr, sizeof(port_cstr), "127.0.0.1:%i", port_); + snprintf(port_cstr, sizeof(port_cstr), "localhost:%i", port_); // Send the host and port down that debugserver and specify an option // so that it connects back to the port we are listening to in this // process @@ -1102,7 +1102,7 @@ if (port) *port = port_; } else { - error.SetErrorString("failed to bind to port 0 on 127.0.0.1"); + error.SetErrorString("failed to bind to port 0 on localhost"); if (log) log->Printf("GDBRemoteCommunication::%s() failed: %s", __FUNCTION__, error.AsCString()); @@ -1269,7 +1269,7 @@ const int backlog = 5; TCPSocket listen_socket(true, child_processes_inherit); if (llvm::Error error = - listen_socket.Listen("127.0.0.1:0", backlog).ToError()) + listen_socket.Listen("localhost:0", backlog).ToError()) return error; Socket *accept_socket; @@ -1278,7 +1278,7 @@ llvm::SmallString<32> remote_addr; llvm::raw_svector_ostream(remote_addr) - << "connect://127.0.0.1:" << listen_socket.GetLocalPortNumber(); + << "connect://localhost:" << listen_socket.GetLocalPortNumber(); std::unique_ptr conn_up( new ConnectionFileDescriptor());