summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/TCPSocket.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/TCPSocket.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/TCPSocket.cpp')
-rw-r--r--lldb/source/Host/common/TCPSocket.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/source/Host/common/TCPSocket.cpp b/lldb/source/Host/common/TCPSocket.cpp
index f97ca9eb55b..201ddd352dd 100644
--- a/lldb/source/Host/common/TCPSocket.cpp
+++ b/lldb/source/Host/common/TCPSocket.cpp
@@ -118,6 +118,14 @@ std::string TCPSocket::GetRemoteIPAddress() const {
return "";
}
+std::string TCPSocket::GetRemoteConnectionURI() const {
+ if (m_socket != kInvalidSocketValue) {
+ return llvm::formatv("connect://[{0}]:{1}", GetRemoteIPAddress(),
+ GetRemotePortNumber());
+ }
+ return "";
+};
+
Status TCPSocket::CreateSocket(int domain) {
Status error;
if (IsValid())
OpenPOWER on IntegriCloud