Add support for the qEcho command to lldb-server in the common packets.

llvm-svn: 238533
This commit is contained in:
Greg Clayton 2015-05-29 00:15:15 +00:00
parent de4c598ccf
commit 420562aa82
4 changed files with 18 additions and 0 deletions

View File

@ -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
@ -1152,6 +1155,13 @@ GDBRemoteCommunicationServerCommon::Handle_A (StringExtractorGDBRemote &packet)
return SendErrorResponse (8);
}
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)
{

View File

@ -109,6 +109,9 @@ protected:
PacketResult
Handle_vFile_MD5 (StringExtractorGDBRemote &packet);
PacketResult
Handle_qEcho (StringExtractorGDBRemote &packet);
PacketResult
Handle_qModuleInfo (StringExtractorGDBRemote &packet);

View File

@ -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;

View File

@ -50,6 +50,7 @@ public:
eServerPacketType_qfProcessInfo,
eServerPacketType_qsProcessInfo,
eServerPacketType_qC,
eServerPacketType_qEcho,
eServerPacketType_qGroupName,
eServerPacketType_qHostInfo,
eServerPacketType_qLaunchGDBServer,