aboutsummaryrefslogtreecommitdiff
path: root/lldb
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2015-05-29 00:15:15 +0000
committerGreg Clayton <gclayton@apple.com>2015-05-29 00:15:15 +0000
commit420562aa82f8a81675772f795ca22c74ae817128 (patch)
treec48d4d124b81482700e370c407e67d7e1d54750b /lldb
parentde4c598ccf35f8f58b736e72c50916e2b26faec1 (diff)
downloadllvm-420562aa82f8a81675772f795ca22c74ae817128.zip
llvm-420562aa82f8a81675772f795ca22c74ae817128.tar.gz
llvm-420562aa82f8a81675772f795ca22c74ae817128.tar.bz2
Add support for the qEcho command to lldb-server in the common packets.
llvm-svn: 238533
Diffstat (limited to 'lldb')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp10
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h3
-rw-r--r--lldb/source/Utility/StringExtractorGDBRemote.cpp4
-rw-r--r--lldb/source/Utility/StringExtractorGDBRemote.h1
4 files changed, 18 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
index 0cc528f..37aed54 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -87,6 +87,8 @@ GDBRemoteCommunicationServerCommon::GDBRemoteCommunicationServerCommon(const cha
&GDBRemoteCommunicationServerCommon::Handle_qLaunchSuccess);
RegisterMemberFunctionHandler(StringExtractorGDBRemote::eServerPacketType_QListThreadsInStopReply,
&GDBRemoteCommunicationServerCommon::Handle_QListThreadsInStopReply);
+ RegisterMemberFunctionHandler(StringExtractorGDBRemote::eServerPacketType_qEcho,
+ &GDBRemoteCommunicationServerCommon::Handle_qEcho);
RegisterMemberFunctionHandler(StringExtractorGDBRemote::eServerPacketType_qModuleInfo,
&GDBRemoteCommunicationServerCommon::Handle_qModuleInfo);
RegisterMemberFunctionHandler(StringExtractorGDBRemote::eServerPacketType_qPlatform_chmod,
@@ -915,6 +917,7 @@ GDBRemoteCommunicationServerCommon::Handle_qSupported (StringExtractorGDBRemote
response.PutCString (";QStartNoAckMode+");
response.PutCString (";QThreadSuffixSupported+");
response.PutCString (";QListThreadsInStopReply+");
+ response.PutCString (";qEcho");
#if defined(__linux__)
response.PutCString (";qXfer:auxv:read+");
#endif
@@ -1153,6 +1156,13 @@ GDBRemoteCommunicationServerCommon::Handle_A (StringExtractorGDBRemote &packet)
}
GDBRemoteCommunication::PacketResult
+GDBRemoteCommunicationServerCommon::Handle_qEcho (StringExtractorGDBRemote &packet)
+{
+ // Just echo back the exact same packet for qEcho...
+ return SendPacketNoLock(packet.GetStringRef().c_str(), packet.GetStringRef().size());
+}
+
+GDBRemoteCommunication::PacketResult
GDBRemoteCommunicationServerCommon::Handle_qModuleInfo (StringExtractorGDBRemote &packet)
{
packet.SetFilePos(::strlen ("qModuleInfo:"));
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
index cb79d10..62b129b 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
@@ -110,6 +110,9 @@ protected:
Handle_vFile_MD5 (StringExtractorGDBRemote &packet);
PacketResult
+ Handle_qEcho (StringExtractorGDBRemote &packet);
+
+ PacketResult
Handle_qModuleInfo (StringExtractorGDBRemote &packet);
PacketResult
diff --git a/lldb/source/Utility/StringExtractorGDBRemote.cpp b/lldb/source/Utility/StringExtractorGDBRemote.cpp
index 7497992..718c8f6 100644
--- a/lldb/source/Utility/StringExtractorGDBRemote.cpp
+++ b/lldb/source/Utility/StringExtractorGDBRemote.cpp
@@ -140,6 +140,10 @@ StringExtractorGDBRemote::GetServerPacketType () const
if (packet_size == 2) return eServerPacketType_qC;
break;
+ case 'E':
+ if (PACKET_STARTS_WITH ("qEcho:")) return eServerPacketType_qEcho;
+ break;
+
case 'G':
if (PACKET_STARTS_WITH ("qGroupName:")) return eServerPacketType_qGroupName;
if (PACKET_MATCHES ("qGetWorkingDir")) return eServerPacketType_qGetWorkingDir;
diff --git a/lldb/source/Utility/StringExtractorGDBRemote.h b/lldb/source/Utility/StringExtractorGDBRemote.h
index cb53758..78f6021 100644
--- a/lldb/source/Utility/StringExtractorGDBRemote.h
+++ b/lldb/source/Utility/StringExtractorGDBRemote.h
@@ -50,6 +50,7 @@ public:
eServerPacketType_qfProcessInfo,
eServerPacketType_qsProcessInfo,
eServerPacketType_qC,
+ eServerPacketType_qEcho,
eServerPacketType_qGroupName,
eServerPacketType_qHostInfo,
eServerPacketType_qLaunchGDBServer,