summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote
diff options
context:
space:
mode:
authorChaoren Lin <chaorenl@google.com>2015-03-31 22:37:59 +0000
committerChaoren Lin <chaorenl@google.com>2015-03-31 22:37:59 +0000
commit0ddb72263f8354a8ebb5d41b931812f8c6af68cc (patch)
tree58490fcaeb37664e35451a2b076dba5edc6ba0a1 /lldb/source/Plugins/Process/gdb-remote
parenta225a19dd0739024f6a232d601c381d217483ca8 (diff)
downloadbcm5719-llvm-0ddb72263f8354a8ebb5d41b931812f8c6af68cc.tar.gz
bcm5719-llvm-0ddb72263f8354a8ebb5d41b931812f8c6af68cc.zip
Implement Handle_QEnvironmentHexEncoded.
Reviewers: clayborg, ovyalov, chaoren Reviewed By: chaoren Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8689 llvm-svn: 233768
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp17
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h5
2 files changed, 21 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
index 74e27beceff..2e14c38ed44 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -71,6 +71,8 @@ GDBRemoteCommunicationServerCommon::GDBRemoteCommunicationServerCommon(const cha
&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::Handle_QEnvironment (StringExtractorGDBRemot
}
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:"));
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
index c11a927ead4..cb79d106af1 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
@@ -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);
OpenPOWER on IntegriCloud