[Lldb-commits] [lldb] r233768 - Implement Handle_QEnvironmentHexEncoded.

Chaoren Lin chaorenl at google.com
Tue Mar 31 15:37:59 PDT 2015


Author: chaoren
Date: Tue Mar 31 17:37:59 2015
New Revision: 233768

URL: http://llvm.org/viewvc/llvm-project?rev=233768&view=rev
Log:
Implement Handle_QEnvironmentHexEncoded.

Reviewers: clayborg, ovyalov, chaoren

Reviewed By: chaoren

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8689

Modified:
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.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=233768&r1=233767&r2=233768&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp Tue Mar 31 17:37:59 2015
@@ -71,6 +71,8 @@ GDBRemoteCommunicationServerCommon::GDBR
                                   &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 @@ GDBRemoteCommunicationServerCommon::Hand
 }
 
 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:"));

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=233768&r1=233767&r2=233768&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h Tue Mar 31 17:37:59 2015
@@ -149,7 +149,10 @@ protected:
     Handle_qLaunchSuccess (StringExtractorGDBRemote &packet);
 
     PacketResult
-    Handle_QEnvironment  (StringExtractorGDBRemote &packet);
+    Handle_QEnvironment (StringExtractorGDBRemote &packet);
+
+    PacketResult
+    Handle_QEnvironmentHexEncoded (StringExtractorGDBRemote &packet);
 
     PacketResult
     Handle_QLaunchArch (StringExtractorGDBRemote &packet);





More information about the lldb-commits mailing list