summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
diff options
context:
space:
mode:
authorOleksiy Vyalov <ovyalov@google.com>2015-10-15 23:54:09 +0000
committerOleksiy Vyalov <ovyalov@google.com>2015-10-15 23:54:09 +0000
commite98628cecbe1d1731a5b0181a0d2723621cb297c (patch)
treedac18f72df0ba71eb7d77b64d35ed3733511095b /lldb/source/Plugins
parent15709991d09d940834029baf20a078d44f55234a (diff)
downloadbcm5719-llvm-e98628cecbe1d1731a5b0181a0d2723621cb297c.tar.gz
bcm5719-llvm-e98628cecbe1d1731a5b0181a0d2723621cb297c.zip
Split Socket class into Tcp/Udp/DomainSocket subclasses.
http://reviews.llvm.org/D13754 llvm-svn: 250474
Diffstat (limited to 'lldb/source/Plugins')
-rw-r--r--lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp20
-rw-r--r--lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp4
2 files changed, 12 insertions, 12 deletions
diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
index 4eb1e811cb6..3e07442994b 100644
--- a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
+++ b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
@@ -10,9 +10,7 @@
// Other libraries and framework includes
#include "lldb/Core/Error.h"
#include "lldb/Core/Log.h"
-#include "lldb/Host/Socket.h"
-
-// Project includes
+#include "lldb/Host/common/TCPSocket.h"
#include "AdbClient.h"
#include "PlatformAndroidRemoteGDBServer.h"
#include "Utility/UriParser.h"
@@ -52,13 +50,15 @@ DeleteForwardPortWithAdb (uint16_t local_port, const std::string& device_id)
static Error
FindUnusedPort (uint16_t& port)
{
- Socket* socket = nullptr;
- auto error = Socket::TcpListen ("127.0.0.1:0", false, socket, nullptr);
- if (error.Success ())
- {
- port = socket->GetLocalPortNumber ();
- delete socket;
- }
+ Error error;
+ std::unique_ptr<TCPSocket> tcp_socket(new TCPSocket(false, error));
+ if (error.Fail())
+ return error;
+
+ error = tcp_socket->Listen("127.0.0.1:0", 1);
+ if (error.Success())
+ port = tcp_socket->GetLocalPortNumber();
+
return error;
}
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
index b3dca1f20ab..b0961e5278c 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
@@ -24,8 +24,8 @@
#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/Symbols.h"
-#include "lldb/Host/Socket.h"
#include "lldb/Host/ThreadLauncher.h"
+#include "lldb/Host/common/TCPSocket.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandObject.h"
#include "lldb/Interpreter/CommandObjectMultiword.h"
@@ -276,7 +276,7 @@ ProcessKDP::DoConnectRemote (Stream *strm, const char *remote_url)
if (conn_ap->IsConnected())
{
- const Socket& socket = static_cast<const Socket&>(*conn_ap->GetReadObject());
+ const TCPSocket& socket = static_cast<const TCPSocket&>(*conn_ap->GetReadObject());
const uint16_t reply_port = socket.GetLocalPortNumber();
if (reply_port != 0)
OpenPOWER on IntegriCloud