Author: gclayton
Date: Thu May 28 19:15:15 2015
New Revision: 238533

URL: http://llvm.org/viewvc/llvm-project?rev=238533&view=rev
Log:
Add support for the qEcho command to lldb-server in the common packets.


Modified:
    
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
    
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
    lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp
    lldb/trunk/source/Utility/StringExtractorGDBRemote.h

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp?rev=238533&r1=238532&r2=238533&view=diff
==============================================================================
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
 Thu May 28 19:15:15 2015
@@ -87,6 +87,8 @@ GDBRemoteCommunicationServerCommon::GDBR
                                   
&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::Hand
     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::Hand
 }
 
 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:"));

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h?rev=238533&r1=238532&r2=238533&view=diff
==============================================================================
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
 (original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
 Thu May 28 19:15:15 2015
@@ -110,6 +110,9 @@ protected:
     Handle_vFile_MD5 (StringExtractorGDBRemote &packet);
 
     PacketResult
+    Handle_qEcho (StringExtractorGDBRemote &packet);
+
+    PacketResult
     Handle_qModuleInfo (StringExtractorGDBRemote &packet);
 
     PacketResult

Modified: lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp?rev=238533&r1=238532&r2=238533&view=diff
==============================================================================
--- lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp (original)
+++ lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp Thu May 28 19:15:15 
2015
@@ -140,6 +140,10 @@ StringExtractorGDBRemote::GetServerPacke
             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;

Modified: lldb/trunk/source/Utility/StringExtractorGDBRemote.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/StringExtractorGDBRemote.h?rev=238533&r1=238532&r2=238533&view=diff
==============================================================================
--- lldb/trunk/source/Utility/StringExtractorGDBRemote.h (original)
+++ lldb/trunk/source/Utility/StringExtractorGDBRemote.h Thu May 28 19:15:15 
2015
@@ -50,6 +50,7 @@ public:
         eServerPacketType_qfProcessInfo,
         eServerPacketType_qsProcessInfo,
         eServerPacketType_qC,
+        eServerPacketType_qEcho,
         eServerPacketType_qGroupName,
         eServerPacketType_qHostInfo,
         eServerPacketType_qLaunchGDBServer,


_______________________________________________
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to