diff options
Diffstat (limited to 'lldb/source/Plugins/Process')
4 files changed, 63 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 9b7143b792e..ac76889079a 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -88,6 +88,7 @@ GDBRemoteCommunicationClient::GDBRemoteCommunicationClient() m_supports_augmented_libraries_svr4_read(eLazyBoolCalculate), m_supports_jThreadExtendedInfo(eLazyBoolCalculate), m_supports_jLoadedDynamicLibrariesInfos(eLazyBoolCalculate), + m_supports_jGetSharedCacheInfo (eLazyBoolCalculate), m_supports_qProcessInfoPID(true), m_supports_qfProcessInfo(true), m_supports_qUserName(true), @@ -677,6 +678,24 @@ GDBRemoteCommunicationClient::GetLoadedDynamicLibrariesInfosSupported () } bool +GDBRemoteCommunicationClient::GetSharedCacheInfoSupported () +{ + if (m_supports_jGetSharedCacheInfo == eLazyBoolCalculate) + { + StringExtractorGDBRemote response; + m_supports_jGetSharedCacheInfo = eLazyBoolNo; + if (SendPacketAndWaitForResponse("jGetSharedCacheInfo:", response, false) == PacketResult::Success) + { + if (response.IsOKResponse()) + { + m_supports_jGetSharedCacheInfo = eLazyBoolYes; + } + } + } + return m_supports_jGetSharedCacheInfo; +} + +bool GDBRemoteCommunicationClient::GetxPacketSupported () { if (m_supports_x == eLazyBoolCalculate) diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h index 096c4cf8101..7088bc0287c 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h @@ -560,6 +560,9 @@ public: GetLoadedDynamicLibrariesInfosSupported(); bool + GetSharedCacheInfoSupported(); + + bool GetModuleInfo (const FileSpec& module_file_spec, const ArchSpec& arch_spec, ModuleSpec &module_spec); @@ -605,6 +608,7 @@ protected: LazyBool m_supports_augmented_libraries_svr4_read; LazyBool m_supports_jThreadExtendedInfo; LazyBool m_supports_jLoadedDynamicLibrariesInfos; + LazyBool m_supports_jGetSharedCacheInfo; bool m_supports_qProcessInfoPID:1, 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. // diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h index 694e16656b4..b974db684f6 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -270,6 +270,9 @@ public: StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos_sender (StructuredData::ObjectSP args); + StructuredData::ObjectSP + GetSharedCacheInfo () override; + protected: friend class ThreadGDBRemote; friend class GDBRemoteCommunicationClient; |