diff options
author | Pavel Labath <pavel@labath.sk> | 2025-06-24 11:11:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-24 11:11:35 +0200 |
commit | cf9546b826619890e965367a3e4d0da1991ba929 (patch) | |
tree | 163de38457012b97304d3433317a43a09e773334 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | |
parent | 46e1e9f104c853a49316b86ff0c6ca4380735a09 (diff) | |
download | llvm-cf9546b826619890e965367a3e4d0da1991ba929.zip llvm-cf9546b826619890e965367a3e4d0da1991ba929.tar.gz llvm-cf9546b826619890e965367a3e4d0da1991ba929.tar.bz2 |
[lldb] Remove GDBRemoteCommunication::ConnectLocally (#145293)
Originally added for reproducers, it is now only used for test code.
While we could make it a test helper, I think that after #145015 it is
simple enough to not be needed.
Also squeeze in a change to make ConnectionFileDescriptor accept a
unique_ptr<Socket>.
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index d1f57cc..0d3ead8 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -1128,8 +1128,8 @@ Status GDBRemoteCommunication::StartDebugserverProcess( Socket *accepted_socket = nullptr; error = sock_up->Accept(/*timeout=*/std::nullopt, accepted_socket); if (accepted_socket) { - SetConnection( - std::make_unique<ConnectionFileDescriptor>(accepted_socket)); + SetConnection(std::make_unique<ConnectionFileDescriptor>( + std::unique_ptr<Socket>(accepted_socket))); } } @@ -1138,20 +1138,6 @@ Status GDBRemoteCommunication::StartDebugserverProcess( void GDBRemoteCommunication::DumpHistory(Stream &strm) { m_history.Dump(strm); } -llvm::Error -GDBRemoteCommunication::ConnectLocally(GDBRemoteCommunication &client, - GDBRemoteCommunication &server) { - llvm::Expected<Socket::Pair> pair = Socket::CreatePair(); - if (!pair) - return pair.takeError(); - - client.SetConnection( - std::make_unique<ConnectionFileDescriptor>(pair->first.release())); - server.SetConnection( - std::make_unique<ConnectionFileDescriptor>(pair->second.release())); - return llvm::Error::success(); -} - GDBRemoteCommunication::ScopedTimeout::ScopedTimeout( GDBRemoteCommunication &gdb_comm, std::chrono::seconds timeout) : m_gdb_comm(gdb_comm), m_saved_timeout(0), m_timeout_modified(false) { |