diff options
author | Jason Molenda <jmolenda@apple.com> | 2019-04-08 23:03:02 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2019-04-08 23:03:02 +0000 |
commit | 1724a179e7ae2d0485f0fc8fee7ac3a18cc29152 (patch) | |
tree | 87bbd2f536267e1116e4243d67fe446449be3c35 /lldb/source/Core/DynamicLoader.cpp | |
parent | e794752bdfb334b64b2d356e9c0444572ad19da1 (diff) | |
download | bcm5719-llvm-1724a179e7ae2d0485f0fc8fee7ac3a18cc29152.tar.gz bcm5719-llvm-1724a179e7ae2d0485f0fc8fee7ac3a18cc29152.zip |
Rename Target::GetSharedModule to Target::GetOrCreateModule.
Add a flag to control whether the ModulesDidLoad notification is
called when a module is added. If the notifications are disabled,
the caller must call ModulesDidLoad after adding all the new modules,
but postponing this notification until they're all batched up can
allow for better efficiency than notifying one-by-one.
Change the name of the ModuleList notifier functions that a subclass
can implement to start with 'Notify' to make it clear what they are.
Add a NotifyModulesRemoved.
Add header documentation for the changed/updated methods.
Added defaulted-value 'notify' argument to ModuleList Append,
AppendIfNeeded, and Remove because callers working with a local
ModuleList don't have an obvious idea of what notify means in this
context. When the ModuleList is a part of the Target class, the
notify behavior matters.
DynamicLoaderDarwin has been updated so that libraries being
added/removed are correctly batched up before notifications are
sent. Added the TestModuleLoadedNotifys.py test to run on
Darwin to test this.
<rdar://problem/48293064>
Differential Revision: https://reviews.llvm.org/D60172
llvm-svn: 357955
Diffstat (limited to 'lldb/source/Core/DynamicLoader.cpp')
-rw-r--r-- | lldb/source/Core/DynamicLoader.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lldb/source/Core/DynamicLoader.cpp b/lldb/source/Core/DynamicLoader.cpp index a5805399b06..c773caa1f21 100644 --- a/lldb/source/Core/DynamicLoader.cpp +++ b/lldb/source/Core/DynamicLoader.cpp @@ -96,7 +96,7 @@ ModuleSP DynamicLoader::GetTargetExecutable() { } if (!executable) { - executable = target.GetSharedModule(module_spec); + executable = target.GetOrCreateModule(module_spec, true /* notify */); if (executable.get() != target.GetExecutableModulePointer()) { // Don't load dependent images since we are in dyld where we will // know and find out about all images that are loaded @@ -166,7 +166,8 @@ ModuleSP DynamicLoader::LoadModuleAtAddress(const FileSpec &file, return module_sp; } - if ((module_sp = target.GetSharedModule(module_spec))) { + if ((module_sp = target.GetOrCreateModule(module_spec, + true /* notify */))) { UpdateLoadedSections(module_sp, link_map_addr, base_addr, base_addr_is_offset); return module_sp; @@ -202,7 +203,8 @@ ModuleSP DynamicLoader::LoadModuleAtAddress(const FileSpec &file, return module_sp; } - if ((module_sp = target.GetSharedModule(new_module_spec))) { + if ((module_sp = target.GetOrCreateModule(new_module_spec, + true /* notify */))) { UpdateLoadedSections(module_sp, link_map_addr, base_addr, false); return module_sp; } |