summaryrefslogtreecommitdiffstats
path: root/lldb/source/Utility/GDBRemote.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Utility/GDBRemote.cpp')
-rw-r--r--lldb/source/Utility/GDBRemote.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/lldb/source/Utility/GDBRemote.cpp b/lldb/source/Utility/GDBRemote.cpp
index f0982922a89..85c4bc69a8d 100644
--- a/lldb/source/Utility/GDBRemote.cpp
+++ b/lldb/source/Utility/GDBRemote.cpp
@@ -51,6 +51,23 @@ void GDBRemotePacket::Serialize(raw_ostream &strm) const {
strm.flush();
}
+llvm::StringRef GDBRemotePacket::GetTypeStr() const {
+ switch (type) {
+ case GDBRemotePacket::ePacketTypeSend:
+ return "send";
+ case GDBRemotePacket::ePacketTypeRecv:
+ return "read";
+ case GDBRemotePacket::ePacketTypeInvalid:
+ return "invalid";
+ }
+ llvm_unreachable("All enum cases should be handled");
+}
+
+void GDBRemotePacket::Dump(Stream &strm) const {
+ strm.Printf("tid=0x%4.4" PRIx64 " <%4u> %s packet: %s\n", tid,
+ bytes_transmitted, GetTypeStr().data(), packet.data.c_str());
+}
+
void yaml::ScalarEnumerationTraits<GDBRemotePacket::Type>::enumeration(
IO &io, GDBRemotePacket::Type &value) {
io.enumCase(value, "Invalid", GDBRemotePacket::ePacketTypeInvalid);
OpenPOWER on IntegriCloud