summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/Process
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2017-04-26 23:17:20 +0000
committerChris Bieneman <beanz@apple.com>2017-04-26 23:17:20 +0000
commit1182779917b3c1681274e6feaa4d36e51b7e142e (patch)
tree9c5a53efa92db6eecf0df4fd9d9e7987dcd5926e /lldb/unittests/Process
parent0fcbb2893eca48b9cf661e7ee82e8b94c89228b6 (diff)
downloadbcm5719-llvm-1182779917b3c1681274e6feaa4d36e51b7e142e.tar.gz
bcm5719-llvm-1182779917b3c1681274e6feaa4d36e51b7e142e.zip
Re-landing IPv6 support for LLDB Host
This support was landed in r300579, and reverted in r300669 due to failures on the bots. The failures were caused by sockets not being properly closed, and this updated version of the patches should resolve that. Summary from the original change: This patch adds IPv6 support to LLDB/Host's TCP socket implementation. Supporting IPv6 involved a few significant changes to the implementation of the socket layers, and I have performed some significant code cleanup along the way. This patch changes the Socket constructors for all types of sockets to not create sockets until first use. This is required for IPv6 support because the socket type will vary based on the address you are connecting to. This also has the benefit of removing code that could have errors from the Socket subclass constructors (which seems like a win to me). The patch also slightly changes the API and behaviors of the Listen/Accept pattern. Previously both Listen and Accept calls took an address specified as a string. Now only listen does. This change was made because the Listen call can result in opening more than one socket. In order to support listening for both IPv4 and IPv6 connections we need to open one AF_INET socket and one AF_INET6 socket. During the listen call we construct a map of file descriptors to addrin structures which represent the allowable incoming connection address. This map removes the need for taking an address into the Accept call. This does have a change in functionality. Previously you could Listen for connections based on one address, and Accept connections from a different address. This is no longer supported. I could not find anywhere in LLDB where we actually used the APIs in that way. The new API does still support AnyAddr for allowing incoming connections from any address. The Listen implementation is implemented using kqueue on FreeBSD and Darwin, WSAPoll on Windows and poll(2) everywhere else. https://reviews.llvm.org/D31823 llvm-svn: 301492
Diffstat (limited to 'lldb/unittests/Process')
-rw-r--r--lldb/unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp
index 08501f50f65..6440e814efd 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp
@@ -33,15 +33,14 @@ void GDBRemoteTest::TearDownTestCase() {
void Connect(GDBRemoteCommunication &client, GDBRemoteCommunication &server) {
bool child_processes_inherit = false;
Error error;
- TCPSocket listen_socket(child_processes_inherit, error);
+ TCPSocket listen_socket(true, child_processes_inherit);
ASSERT_FALSE(error.Fail());
error = listen_socket.Listen("127.0.0.1:0", 5);
ASSERT_FALSE(error.Fail());
Socket *accept_socket;
std::future<Error> accept_error = std::async(std::launch::async, [&] {
- return listen_socket.Accept("127.0.0.1:0", child_processes_inherit,
- accept_socket);
+ return listen_socket.Accept(accept_socket);
});
char connect_remote_address[64];
OpenPOWER on IntegriCloud