llvm-project/lldb/unittests/Host
Antonio Afonso 3da8e5f920 Fix IPv6 support on lldb-server platform
Summary:
This is a general fix for the ConnectionFileDescriptor class but my main motivation was to make lldb-server working with IPv6.
The connect URI can use square brackets ([]) to wrap the interface part of the URI (e.g.: <scheme>://[<interface>]:<port>). For IPv6 addresses this is a must since its ip can include colons and it will overlap with the port colon otherwise. The URIParser class parses the square brackets correctly but the ConnectionFileDescriptor doesn't generate them for IPv6 addresses making it impossible to connect to the gdb server when using this protocol.

How to reproduce the issue:
```
$ lldb-server p --server --listen [::1]:8080
...
$ lldb
(lldb) platform select remote-macosx
(lldb) platform connect connect://[::1]:8080
(lldb) platform process -p <pid>
error: unable to launch a GDB server on 'computer'
```

The server was actually launched we were just not able to connect to it. With this fix lldb will correctly connect. I fixed this by wrapping the ip portion with [].

Reviewers: labath

Reviewed By: labath

Subscribers: xiaobai, mgorny, jfb, lldb-commits, labath

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D61833

llvm-svn: 361898
2019-05-28 23:26:32 +00:00
..
linux Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt Fix IPv6 support on lldb-server platform 2019-05-28 23:26:32 +00:00
ConnectionFileDescriptorTest.cpp Fix IPv6 support on lldb-server platform 2019-05-28 23:26:32 +00:00
FileActionTest.cpp Fix headers for files added in r353047 2019-02-07 17:16:25 +00:00
FileSystemTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
HostInfoTest.cpp Clear the output string passed to GetHostName() 2019-04-17 03:13:06 +00:00
HostTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MainLoopTest.cpp [lldb-server] Introduce Socket::Initialize and Terminate to simply WSASocket setup 2019-04-10 04:57:18 +00:00
NativeProcessProtocolTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ProcessLaunchInfoTest.cpp Fix headers for files added in r353047 2019-02-07 17:16:25 +00:00
SocketAddressTest.cpp [lldb-server] Introduce Socket::Initialize and Terminate to simply WSASocket setup 2019-04-10 04:57:18 +00:00
SocketTest.cpp Fix IPv6 support on lldb-server platform 2019-05-28 23:26:32 +00:00
SocketTestUtilities.cpp Fix IPv6 support on lldb-server platform 2019-05-28 23:26:32 +00:00
SocketTestUtilities.h Fix IPv6 support on lldb-server platform 2019-05-28 23:26:32 +00:00
TaskPoolTest.cpp [lldb] A few minor fixes in TaskPool 2017-11-30 22:56:11 +00:00