summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2016-07-22 00:17:55 +0000
committerJason Molenda <jmolenda@apple.com>2016-07-22 00:17:55 +0000
commit37397353cc610d47c566ad8fba16f36224a514c8 (patch)
tree9389efe67b1a38d5657901f7ae06344dccf61391 /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
parent0e2cec075c98fe33623229dcb6ee6275f2897de4 (diff)
downloadbcm5719-llvm-37397353cc610d47c566ad8fba16f36224a514c8.tar.gz
bcm5719-llvm-37397353cc610d47c566ad8fba16f36224a514c8.zip
Add support to get the shared cache information from the new
debugserver jGetSharedCacheInfo packet instead of reading the dyld internal data structures directly. This code is (currently) only used for ios native lldb's - I should really move this ObjectFileMachO::GetProcessSharedCacheUUID method somewhere else, it makes less and less sense being in the file reader. <rdar://problem/25251243> llvm-svn: 276369
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 728c5123dda..1cea670bd72 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4270,6 +4270,43 @@ ProcessGDBRemote::GetLoadedDynamicLibrariesInfos_sender (StructuredData::ObjectS
+StructuredData::ObjectSP
+ProcessGDBRemote::GetSharedCacheInfo ()
+{
+ StructuredData::ObjectSP object_sp;
+ StructuredData::ObjectSP args_dict(new StructuredData::Dictionary());
+
+ if (m_gdb_comm.GetSharedCacheInfoSupported())
+ {
+ StreamString packet;
+ packet << "jGetSharedCacheInfo:";
+ args_dict->Dump (packet, false);
+
+ // FIXME the final character of a JSON dictionary, '}', is the escape
+ // character in gdb-remote binary mode. lldb currently doesn't escape
+ // these characters in its packet output -- so we add the quoted version
+ // of the } character here manually in case we talk to a debugserver which
+ // un-escapes the characters at packet read time.
+ packet << (char) (0x7d ^ 0x20);
+
+ StringExtractorGDBRemote response;
+ response.SetResponseValidatorToJSON();
+ if (m_gdb_comm.SendPacketAndWaitForResponse(packet.GetData(), packet.GetSize(), response, false) == GDBRemoteCommunication::PacketResult::Success)
+ {
+ StringExtractorGDBRemote::ResponseType response_type = response.GetResponseType();
+ if (response_type == StringExtractorGDBRemote::eResponse)
+ {
+ if (!response.Empty())
+ {
+ object_sp = StructuredData::ParseJSON (response.GetStringRef());
+ }
+ }
+ }
+ }
+ return object_sp;
+}
+
+
// Establish the largest memory read/write payloads we should use.
// If the remote stub has a max packet size, stay under that size.
//
OpenPOWER on IntegriCloud