[Lldb-commits] [lldb] r331180 - llgs tests: Use noack-mode for communication to avoid pr37294
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Apr 30 07:30:03 PDT 2018
Author: labath
Date: Mon Apr 30 07:30:02 2018
New Revision: 331180
URL: http://llvm.org/viewvc/llvm-project?rev=331180&view=rev
Log:
llgs tests: Use noack-mode for communication to avoid pr37294
Modified:
lldb/trunk/unittests/tools/lldb-server/tests/TestClient.cpp
lldb/trunk/unittests/tools/lldb-server/tests/TestClient.h
Modified: lldb/trunk/unittests/tools/lldb-server/tests/TestClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/tools/lldb-server/tests/TestClient.cpp?rev=331180&r1=331179&r2=331180&view=diff
==============================================================================
--- lldb/trunk/unittests/tools/lldb-server/tests/TestClient.cpp (original)
+++ lldb/trunk/unittests/tools/lldb-server/tests/TestClient.cpp Mon Apr 30 07:30:02 2018
@@ -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>> Te
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);
Modified: lldb/trunk/unittests/tools/lldb-server/tests/TestClient.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/tools/lldb-server/tests/TestClient.h?rev=331180&r1=331179&r2=331180&view=diff
==============================================================================
--- lldb/trunk/unittests/tools/lldb-server/tests/TestClient.h (original)
+++ lldb/trunk/unittests/tools/lldb-server/tests/TestClient.h Mon Apr 30 07:30:02 2018
@@ -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();
More information about the lldb-commits
mailing list