[Lldb-commits] [PATCH] Implement Handle_QEnvironmentHexEncoded.

Chaoren Lin chaorenl at google.com
Tue Mar 31 15:40:52 PDT 2015


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8689

Files:
  lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
  lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h

Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -71,6 +71,8 @@
                                   &GDBRemoteCommunicationServerCommon::Handle_A);
     RegisterMemberFunctionHandler(StringExtractorGDBRemote::eServerPacketType_QEnvironment,
                                   &GDBRemoteCommunicationServerCommon::Handle_QEnvironment);
+    RegisterMemberFunctionHandler(StringExtractorGDBRemote::eServerPacketType_QEnvironmentHexEncoded,
+                                  &GDBRemoteCommunicationServerCommon::Handle_QEnvironmentHexEncoded);
     RegisterMemberFunctionHandler(StringExtractorGDBRemote::eServerPacketType_qfProcessInfo,
                                   &GDBRemoteCommunicationServerCommon::Handle_qfProcessInfo);
     RegisterMemberFunctionHandler(StringExtractorGDBRemote::eServerPacketType_qGroupName,
@@ -1023,6 +1025,21 @@
 }
 
 GDBRemoteCommunication::PacketResult
+GDBRemoteCommunicationServerCommon::Handle_QEnvironmentHexEncoded (StringExtractorGDBRemote &packet)
+{
+    packet.SetFilePos(::strlen("QEnvironmentHexEncoded:"));
+    const uint32_t bytes_left = packet.GetBytesLeft();
+    if (bytes_left > 0)
+    {
+        std::string str;
+        packet.GetHexByteString(str);
+        m_process_launch_info.GetEnvironmentEntries().AppendArgument(str.c_str());
+        return SendOKResponse();
+    }
+    return SendErrorResponse(12);
+}
+
+GDBRemoteCommunication::PacketResult
 GDBRemoteCommunicationServerCommon::Handle_QLaunchArch (StringExtractorGDBRemote &packet)
 {
     packet.SetFilePos(::strlen ("QLaunchArch:"));
Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
===================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
@@ -149,7 +149,10 @@
     Handle_qLaunchSuccess (StringExtractorGDBRemote &packet);
 
     PacketResult
-    Handle_QEnvironment  (StringExtractorGDBRemote &packet);
+    Handle_QEnvironment (StringExtractorGDBRemote &packet);
+
+    PacketResult
+    Handle_QEnvironmentHexEncoded (StringExtractorGDBRemote &packet);
 
     PacketResult
     Handle_QLaunchArch (StringExtractorGDBRemote &packet);

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8689.23016.patch
Type: text/x-patch
Size: 2570 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150331/d6c539b9/attachment.bin>


More information about the lldb-commits mailing list