mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-08 17:11:33 +00:00
llgs-tests: use the auto-parsing form of SendMessage for sending the continue packets
llvm-svn: 326671
This commit is contained in:
parent
a476026f70
commit
cdf7a9f16d
@ -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;
|
||||
|
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user