summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationReplayServer.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-09-13 23:14:10 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-09-13 23:14:10 +0000
commitff5225bfb634369e907c889e16cbee36b260362a (patch)
tree139f9eddc776b4dce949daaff7b9e4542f281ffa /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationReplayServer.cpp
parentae530c5c80048ad3802cb1ed0fde77b6adf0fe57 (diff)
downloadbcm5719-llvm-ff5225bfb634369e907c889e16cbee36b260362a.tar.gz
bcm5719-llvm-ff5225bfb634369e907c889e16cbee36b260362a.zip
[Reproducer] Move GDB Remote Packet into Utility. (NFC)
To support dumping the reproducer's GDB remote packets, we need the (de)serialization logic to live in Utility rather than the GDB remote plugin. This patch renames StreamGDBRemote to GDBRemote and moves the relevant packet code there. Its uses in the GDBRemoteCommunicationHistory and the GDBRemoteCommunicationReplayServer are updated as well. Differential revision: https://reviews.llvm.org/D67523 llvm-svn: 371907
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationReplayServer.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationReplayServer.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationReplayServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationReplayServer.cpp
index 39304a6ff94..2d26c550dc7 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationReplayServer.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationReplayServer.cpp
@@ -128,7 +128,7 @@ GDBRemoteCommunicationReplayServer::GetPacketAndSendResponse(
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
while (!m_packet_history.empty()) {
// Pop last packet from the history.
- GDBRemoteCommunicationHistory::Entry entry = m_packet_history.back();
+ GDBRemotePacket entry = m_packet_history.back();
m_packet_history.pop_back();
// We've handled the handshake implicitly before. Skip the packet and move
@@ -136,7 +136,7 @@ GDBRemoteCommunicationReplayServer::GetPacketAndSendResponse(
if (entry.packet.data == "+")
continue;
- if (entry.type == GDBRemoteCommunicationHistory::ePacketTypeSend) {
+ if (entry.type == GDBRemotePacket::ePacketTypeSend) {
if (unexpected(entry.packet.data, packet.GetStringRef())) {
LLDB_LOG(log,
"GDBRemoteCommunicationReplayServer expected packet: '{0}'",
@@ -150,14 +150,14 @@ GDBRemoteCommunicationReplayServer::GetPacketAndSendResponse(
// Ignore QEnvironment packets as they're handled earlier.
if (entry.packet.data.find("QEnvironment") == 1) {
assert(m_packet_history.back().type ==
- GDBRemoteCommunicationHistory::ePacketTypeRecv);
+ GDBRemotePacket::ePacketTypeRecv);
m_packet_history.pop_back();
}
continue;
}
- if (entry.type == GDBRemoteCommunicationHistory::ePacketTypeInvalid) {
+ if (entry.type == GDBRemotePacket::ePacketTypeInvalid) {
LLDB_LOG(
log,
"GDBRemoteCommunicationReplayServer skipped invalid packet: '{0}'",
@@ -176,10 +176,6 @@ GDBRemoteCommunicationReplayServer::GetPacketAndSendResponse(
return packet_result;
}
-LLVM_YAML_IS_DOCUMENT_LIST_VECTOR(
- std::vector<
- lldb_private::process_gdb_remote::GDBRemoteCommunicationHistory::Entry>)
-
llvm::Error
GDBRemoteCommunicationReplayServer::LoadReplayHistory(const FileSpec &path) {
auto error_or_file = MemoryBuffer::getFile(path.GetPath());
OpenPOWER on IntegriCloud