summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-04-30 14:30:02 +0000
committerPavel Labath <labath@google.com>2018-04-30 14:30:02 +0000
commitd2f36c864e8223a29534941e6fac2b9519658d9c (patch)
tree4273d0e0531d2954f72e1367a1bc4051c1751d4e /lldb
parentad9a04295e026762446493564d89154dbb396c85 (diff)
downloadbcm5719-llvm-d2f36c864e8223a29534941e6fac2b9519658d9c.tar.gz
bcm5719-llvm-d2f36c864e8223a29534941e6fac2b9519658d9c.zip
llgs tests: Use noack-mode for communication to avoid pr37294
llvm-svn: 331180
Diffstat (limited to 'lldb')
-rw-r--r--lldb/unittests/tools/lldb-server/tests/TestClient.cpp17
-rw-r--r--lldb/unittests/tools/lldb-server/tests/TestClient.h1
2 files changed, 16 insertions, 2 deletions
diff --git a/lldb/unittests/tools/lldb-server/tests/TestClient.cpp b/lldb/unittests/tools/lldb-server/tests/TestClient.cpp
index 9580358848c..2410b6270f2 100644
--- a/lldb/unittests/tools/lldb-server/tests/TestClient.cpp
+++ b/lldb/unittests/tools/lldb-server/tests/TestClient.cpp
@@ -30,8 +30,6 @@ using namespace llgs_tests;
TestClient::TestClient(std::unique_ptr<Connection> Conn) {
SetConnection(Conn.release());
SetPacketTimeout(std::chrono::seconds(10));
-
- SendAck(); // Send this as a handshake.
}
TestClient::~TestClient() {
@@ -41,6 +39,18 @@ TestClient::~TestClient() {
EXPECT_THAT_ERROR(SendMessage("k"), Succeeded());
}
+Error TestClient::initializeConnection() {
+ if (SendAck() == 0)
+ return make_error<StringError>("Sending initial ACK failed.",
+ inconvertibleErrorCode());
+
+ if (Error E = SendMessage("QStartNoAckMode"))
+ return E;
+
+ m_send_acks = false;
+ return Error::success();
+}
+
Expected<std::unique_ptr<TestClient>> TestClient::launch(StringRef Log) {
return launch(Log, {});
}
@@ -97,6 +107,9 @@ Expected<std::unique_ptr<TestClient>> TestClient::launchCustom(StringRef Log, Ar
auto Conn = llvm::make_unique<ConnectionFileDescriptor>(accept_socket);
auto Client = std::unique_ptr<TestClient>(new TestClient(std::move(Conn)));
+ if (Error E = Client->initializeConnection())
+ return std::move(E);
+
if (!InferiorArgs.empty()) {
if (Error E = Client->queryProcess())
return std::move(E);
diff --git a/lldb/unittests/tools/lldb-server/tests/TestClient.h b/lldb/unittests/tools/lldb-server/tests/TestClient.h
index ebcb4a549b3..286c871f473 100644
--- a/lldb/unittests/tools/lldb-server/tests/TestClient.h
+++ b/lldb/unittests/tools/lldb-server/tests/TestClient.h
@@ -83,6 +83,7 @@ public:
private:
TestClient(std::unique_ptr<lldb_private::Connection> Conn);
+ llvm::Error initializeConnection();
llvm::Error qProcessInfo();
llvm::Error qRegisterInfos();
llvm::Error queryProcess();
OpenPOWER on IntegriCloud