hanchenye-llvm-project/lldb/tools
Chris Bieneman 1182779917 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
2017-04-26 23:17:20 +00:00
..
argdumper Move classes from Core -> Utility. 2017-02-02 21:39:50 +00:00
compact-unwind *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
darwin-debug [CMake] Refactor LLDB libraries and tools to be components 2016-12-15 22:01:17 +00:00
darwin-threads *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
debugserver Re-landing IPv6 support for LLDB Host 2017-04-26 23:17:20 +00:00
driver [Windows] Remove the #include <eh.h> hack. 2017-03-03 20:21:59 +00:00
install-headers add back an Xcode-specific Makefile for header installation 2016-01-28 22:34:36 +00:00
intel-mpx [CMake] Final dependency cleanup patch! 2017-02-08 21:00:46 +00:00
lldb-mi iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
lldb-perf Make lldb -Werror clean for -Wstring-conversion 2017-01-06 00:38:06 +00:00
lldb-server Re-landing IPv6 support for LLDB Host 2017-04-26 23:17:20 +00:00
CMakeLists.txt Add a command to access and manipulate the Intel(R) MPX Boundary Tables. 2017-01-31 18:02:54 +00:00