diff --git a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp --- a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp +++ b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp @@ -122,7 +122,8 @@ ConnectionStatus ConnectionFileDescriptor::Connect(llvm::StringRef path, Status *error_ptr) { - return Connect(path, nullptr, error_ptr); + return Connect( + path, [](llvm::StringRef) {}, error_ptr); } ConnectionStatus diff --git a/lldb/unittests/Host/ConnectionFileDescriptorTest.cpp b/lldb/unittests/Host/ConnectionFileDescriptorTest.cpp --- a/lldb/unittests/Host/ConnectionFileDescriptorTest.cpp +++ b/lldb/unittests/Host/ConnectionFileDescriptorTest.cpp @@ -23,13 +23,22 @@ std::unique_ptr socket_a_up; std::unique_ptr socket_b_up; CreateTCPConnectedSockets(ip, &socket_a_up, &socket_b_up); - auto socket = socket_a_up.release(); + auto *socket = socket_a_up.release(); ConnectionFileDescriptor connection_file_descriptor(socket); std::string uri(connection_file_descriptor.GetURI()); EXPECT_EQ((URI{"connect", ip, socket->GetRemotePortNumber(), "/"}), URI::Parse(uri).getValue()); } + + void TestConnect(std::string ip, std::string path) { + std::unique_ptr socket_a_up; + std::unique_ptr socket_b_up; + CreateTCPConnectedSockets(ip, &socket_a_up, &socket_b_up); + auto *socket = socket_a_up.release(); + ConnectionFileDescriptor connection_file_descriptor(socket); + connection_file_descriptor.Connect(path, nullptr); + } }; TEST_F(ConnectionFileDescriptorTest, TCPGetURIv4) { @@ -43,3 +52,15 @@ return; TestGetURI("::1"); } + +TEST_F(ConnectionFileDescriptorTest, Connectv4) { + if (!HostSupportsIPv4()) + return; + TestConnect("127.0.0.1", "accept://127.0.0.1"); +} + +TEST_F(ConnectionFileDescriptorTest, Connectv6) { + if (!HostSupportsIPv6()) + return; + TestConnect("::1", "accept://::1"); +}