diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-13 19:18:16 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-13 19:18:16 +0000 |
commit | 9e046f02e34fbb93eea1bd8b4136da7fd8d06612 (patch) | |
tree | a5fcd26ec570e8a3262ab7ea7e312930e9014cdd /lldb/unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp | |
parent | 3bea50aeb35704798aefa9acbb8973c7864f3732 (diff) | |
download | bcm5719-llvm-9e046f02e34fbb93eea1bd8b4136da7fd8d06612.tar.gz bcm5719-llvm-9e046f02e34fbb93eea1bd8b4136da7fd8d06612.zip |
Add GDB remote packet reproducer.
llvm-svn: 346780
Diffstat (limited to 'lldb/unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp')
-rw-r--r-- | lldb/unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp index 2acf72744d2..f698fdd796d 100644 --- a/lldb/unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp +++ b/lldb/unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp @@ -9,11 +9,6 @@ #include "GDBRemoteTestUtils.h" -#include "lldb/Host/common/TCPSocket.h" -#include "lldb/Host/posix/ConnectionFileDescriptorPosix.h" - -#include <future> - namespace lldb_private { namespace process_gdb_remote { @@ -30,34 +25,5 @@ void GDBRemoteTest::TearDownTestCase() { #endif } -llvm::Error GDBRemoteTest::Connect(GDBRemoteCommunication &client, - GDBRemoteCommunication &server) { - bool child_processes_inherit = false; - TCPSocket listen_socket(true, child_processes_inherit); - if (llvm::Error error = listen_socket.Listen("127.0.0.1:0", 5).ToError()) - return error; - - Socket *accept_socket; - std::future<Status> accept_status = std::async( - std::launch::async, [&] { return listen_socket.Accept(accept_socket); }); - - llvm::SmallString<32> remote_addr; - llvm::raw_svector_ostream(remote_addr) - << "connect://localhost:" << listen_socket.GetLocalPortNumber(); - - std::unique_ptr<ConnectionFileDescriptor> conn_up( - new ConnectionFileDescriptor()); - if (conn_up->Connect(remote_addr, nullptr) != lldb::eConnectionStatusSuccess) - return llvm::make_error<llvm::StringError>("Unable to connect", - llvm::inconvertibleErrorCode()); - - client.SetConnection(conn_up.release()); - if (llvm::Error error = accept_status.get().ToError()) - return error; - - server.SetConnection(new ConnectionFileDescriptor(accept_socket)); - return llvm::Error::success(); -} - } // namespace process_gdb_remote } // namespace lldb_private |