aboutsummaryrefslogtreecommitdiff
path: root/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2025-06-24 11:11:35 +0200
committerGitHub <noreply@github.com>2025-06-24 11:11:35 +0200
commitcf9546b826619890e965367a3e4d0da1991ba929 (patch)
tree163de38457012b97304d3433317a43a09e773334 /lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
parent46e1e9f104c853a49316b86ff0c6ca4380735a09 (diff)
downloadllvm-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/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp')
-rw-r--r--lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
index 96f377e..f940229 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -8,6 +8,7 @@
#include "Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h"
#include "GDBRemoteTestUtils.h"
#include "lldb/Core/ModuleSpec.h"
+#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/Host/XML.h"
#include "lldb/Target/MemoryRegionInfo.h"
#include "lldb/Utility/DataBuffer.h"
@@ -63,8 +64,12 @@ std::string one_register_hex = "41424344";
class GDBRemoteCommunicationClientTest : public GDBRemoteTest {
public:
void SetUp() override {
- ASSERT_THAT_ERROR(GDBRemoteCommunication::ConnectLocally(client, server),
- llvm::Succeeded());
+ llvm::Expected<Socket::Pair> pair = Socket::CreatePair();
+ ASSERT_THAT_EXPECTED(pair, llvm::Succeeded());
+ client.SetConnection(
+ std::make_unique<ConnectionFileDescriptor>(std::move(pair->first)));
+ server.SetConnection(
+ std::make_unique<ConnectionFileDescriptor>(std::move(pair->second)));
}
protected: