summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/UDPSocket.cpp
diff options
context:
space:
mode:
authorAntonio Afonso <antonio.afonso@gmail.com>2019-05-30 23:30:35 +0000
committerAntonio Afonso <antonio.afonso@gmail.com>2019-05-30 23:30:35 +0000
commitd556095135cf5d4b952b96e4fe7635791b67c2c8 (patch)
tree260f45fc5ec6803c60561e8868ac489ed432341e /lldb/source/Host/common/UDPSocket.cpp
parent375dec5e45146a3ba38f6b91f4b051cbd7467079 (diff)
downloadbcm5719-llvm-d556095135cf5d4b952b96e4fe7635791b67c2c8.tar.gz
bcm5719-llvm-d556095135cf5d4b952b96e4fe7635791b67c2c8.zip
Make ConnectionFileDescription work with all sockets
Summary: My main goal here is to make lldb-server work with Android Studio. This is currently not the case because lldb-server is started in platform mode listening on a domain socket. When Android Studio connects to it lldb-server crashes because even though it's listening on a domain socket as soon as it gets a connection it asserts that it's a TCP connection, which will obviously fails for any non-tcp connection. To do this I came up with a new method called GetConnectURI() in Socket that returns the URI needed to connect to the connected portion of the socket. Reviewers: labath, clayborg, xiaobai Reviewed By: labath Subscribers: mgorny, jfb, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D62089 llvm-svn: 362173
Diffstat (limited to 'lldb/source/Host/common/UDPSocket.cpp')
-rw-r--r--lldb/source/Host/common/UDPSocket.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/source/Host/common/UDPSocket.cpp b/lldb/source/Host/common/UDPSocket.cpp
index e1bcd0c18da..8dbf57d6fe4 100644
--- a/lldb/source/Host/common/UDPSocket.cpp
+++ b/lldb/source/Host/common/UDPSocket.cpp
@@ -134,3 +134,11 @@ Status UDPSocket::Connect(llvm::StringRef name, bool child_processes_inherit,
error.Clear();
return error;
}
+
+std::string UDPSocket::GetRemoteConnectionURI() const {
+ if (m_socket != kInvalidSocketValue) {
+ return llvm::formatv("udp://[{0}]:{1}", m_sockaddr.GetIPAddress(),
+ m_sockaddr.GetPort());
+ }
+ return "";
+}
OpenPOWER on IntegriCloud