diff options
author | Jason Molenda <jmolenda@apple.com> | 2016-07-21 08:30:55 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2016-07-21 08:30:55 +0000 |
commit | 9ab5dc2417f6338cc5ad6ab117f62ba895cc8c20 (patch) | |
tree | ceb3f9242105dd799b091dfe868c01c0ad05aa28 /lldb/source/Plugins/Process/gdb-remote | |
parent | f6c3ccef5ed51587bb60bbe245c10874fcd08d75 (diff) | |
download | bcm5719-llvm-9ab5dc2417f6338cc5ad6ab117f62ba895cc8c20.tar.gz bcm5719-llvm-9ab5dc2417f6338cc5ad6ab117f62ba895cc8c20.zip |
Add a new DynamicLoader plugin that uses SPI that are in development
for the fall (northern hemisphere) 2016 Darwin platforms to learn
about loaded images, instead of reading dyld internal data structures.
These new SPI don't exist on older releases, and new packets are
needed from debugserver to use them (those changes are already committed).
I had to change the minimum deployment target for debugserver in the xcode
project file to macOS 10.10 so that debugserver will use the
[[NSProcessInfo processInfo] operatingSystemVersion]
call in MachProcess::GetOSVersionNumbers to get the operarting system
version # -- this API is only available in macOS 10.10 and newer
("OS X Yosemite", released Oct 2014). If we have many people building
llvm.org lldb on older systems still, we can back off on this for the
llvm.org sources.
There should be no change in behavior with this commit, either to
older darwin systems or newer darwin systems.
For now the new DynamicLoader plugin is never activated - I'm forcing
the old plugin to be used in DynamicLoaderDarwin::UseDYLDSPI.
I'll remove that unconditional use of the old plugin soon, so the
newer plugin is used on the newest Darwin platforms.
<rdar://problem/25251243>
llvm-svn: 276254
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 49 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h | 9 |
2 files changed, 52 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 4d56f6ea3ba..728c5123dda 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -4165,7 +4165,7 @@ ProcessGDBRemote::GetExtendedInfoForThread (lldb::tid_t tid) StreamString packet; packet << "jThreadExtendedInfo:"; - args_dict->Dump (packet); + 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 @@ -4194,6 +4194,44 @@ ProcessGDBRemote::GetExtendedInfoForThread (lldb::tid_t tid) StructuredData::ObjectSP ProcessGDBRemote::GetLoadedDynamicLibrariesInfos (lldb::addr_t image_list_address, lldb::addr_t image_count) { + + StructuredData::ObjectSP args_dict(new StructuredData::Dictionary()); + args_dict->GetAsDictionary()->AddIntegerItem ("image_list_address", image_list_address); + args_dict->GetAsDictionary()->AddIntegerItem ("image_count", image_count); + + return GetLoadedDynamicLibrariesInfos_sender (args_dict); +} + +StructuredData::ObjectSP +ProcessGDBRemote::GetLoadedDynamicLibrariesInfos () +{ + StructuredData::ObjectSP args_dict(new StructuredData::Dictionary()); + + args_dict->GetAsDictionary()->AddBooleanItem ("fetch_all_solibs", true); + + return GetLoadedDynamicLibrariesInfos_sender (args_dict); +} + +StructuredData::ObjectSP +ProcessGDBRemote::GetLoadedDynamicLibrariesInfos (const std::vector<lldb::addr_t> &load_addresses) +{ + StructuredData::ObjectSP args_dict(new StructuredData::Dictionary()); + StructuredData::ArraySP addresses(new StructuredData::Array); + + for (auto addr : load_addresses) + { + StructuredData::ObjectSP addr_sp (new StructuredData::Integer (addr)); + addresses->AddItem (addr_sp); + } + + args_dict->GetAsDictionary()->AddItem ("solib_addresses", addresses); + + return GetLoadedDynamicLibrariesInfos_sender (args_dict); +} + +StructuredData::ObjectSP +ProcessGDBRemote::GetLoadedDynamicLibrariesInfos_sender (StructuredData::ObjectSP args_dict) +{ StructuredData::ObjectSP object_sp; if (m_gdb_comm.GetLoadedDynamicLibrariesInfosSupported()) @@ -4201,13 +4239,9 @@ ProcessGDBRemote::GetLoadedDynamicLibrariesInfos (lldb::addr_t image_list_addres // Scope for the scoped timeout object GDBRemoteCommunication::ScopedTimeout timeout (m_gdb_comm, 10); - StructuredData::ObjectSP args_dict(new StructuredData::Dictionary()); - args_dict->GetAsDictionary()->AddIntegerItem ("image_list_address", image_list_address); - args_dict->GetAsDictionary()->AddIntegerItem ("image_count", image_count); - StreamString packet; packet << "jGetLoadedDynamicLibrariesInfos:"; - args_dict->Dump (packet); + 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 @@ -4233,6 +4267,9 @@ ProcessGDBRemote::GetLoadedDynamicLibrariesInfos (lldb::addr_t image_list_addres 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 6d373965fc4..694e16656b4 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -261,6 +261,15 @@ public: StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos (lldb::addr_t image_list_address, lldb::addr_t image_count) override; + StructuredData::ObjectSP + GetLoadedDynamicLibrariesInfos () override; + + StructuredData::ObjectSP + GetLoadedDynamicLibrariesInfos (const std::vector<lldb::addr_t> &load_addresses) override; + + StructuredData::ObjectSP + GetLoadedDynamicLibrariesInfos_sender (StructuredData::ObjectSP args); + protected: friend class ThreadGDBRemote; friend class GDBRemoteCommunicationClient; |