summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/unittests/tools/lldb-server/tests/MessageObjects.h2
-rw-r--r--lldb/unittests/tools/lldb-server/tests/TestClient.cpp17
2 files changed, 8 insertions, 11 deletions
diff --git a/lldb/unittests/tools/lldb-server/tests/MessageObjects.h b/lldb/unittests/tools/lldb-server/tests/MessageObjects.h
index 699f42d19d8..52e0298ad42 100644
--- a/lldb/unittests/tools/lldb-server/tests/MessageObjects.h
+++ b/lldb/unittests/tools/lldb-server/tests/MessageObjects.h
@@ -90,7 +90,7 @@ parseRegisterValue(const lldb_private::RegisterInfo &Info,
llvm::StringRef HexValue, llvm::support::endianness Endian,
bool ZeroPad = false);
-class StopReply {
+class StopReply : public Parser<std::unique_ptr<StopReply>> {
public:
StopReply() = default;
virtual ~StopReply() = default;
diff --git a/lldb/unittests/tools/lldb-server/tests/TestClient.cpp b/lldb/unittests/tools/lldb-server/tests/TestClient.cpp
index 019e619e8a4..b10cf498496 100644
--- a/lldb/unittests/tools/lldb-server/tests/TestClient.cpp
+++ b/lldb/unittests/tools/lldb-server/tests/TestClient.cpp
@@ -235,23 +235,20 @@ Error TestClient::queryProcess() {
Error TestClient::Continue(StringRef message) {
assert(m_process_info.hasValue());
- std::string response;
- if (Error E = SendMessage(message, response))
- return E;
- auto creation = StopReply::create(response, m_process_info->GetEndian(),
- m_register_infos);
- if (Error E = creation.takeError())
- return E;
+ auto StopReplyOr = SendMessage<StopReply>(
+ message, m_process_info->GetEndian(), m_register_infos);
+ if (!StopReplyOr)
+ return StopReplyOr.takeError();
- m_stop_reply = std::move(*creation);
+ m_stop_reply = std::move(*StopReplyOr);
if (!isa<StopReplyStop>(m_stop_reply)) {
StringExtractorGDBRemote R;
PacketResult result = ReadPacket(R, GetPacketTimeout(), false);
if (result != PacketResult::ErrorDisconnected) {
return make_error<StringError>(
- formatv("Expected connection close after receiving {0}. Got {1}/{2} "
+ formatv("Expected connection close after sending {0}. Got {1}/{2} "
"instead.",
- response, result, R.GetStringRef())
+ message, result, R.GetStringRef())
.str(),
inconvertibleErrorCode());
}
OpenPOWER on IntegriCloud