summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2019-04-08 23:03:02 +0000
committerJason Molenda <jmolenda@apple.com>2019-04-08 23:03:02 +0000
commit1724a179e7ae2d0485f0fc8fee7ac3a18cc29152 (patch)
tree87bbd2f536267e1116e4243d67fe446449be3c35 /lldb/source/Plugins/Process
parente794752bdfb334b64b2d356e9c0444572ad19da1 (diff)
downloadbcm5719-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/Plugins/Process')
-rw-r--r--lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp3
-rw-r--r--lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp3
-rw-r--r--lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp8
3 files changed, 9 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
index 2a248f63f95..e9146b558ef 100644
--- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
@@ -915,7 +915,8 @@ void ProcessWindows::OnDebuggerConnected(lldb::addr_t image_base) {
FileSystem::Instance().Resolve(executable_file);
ModuleSpec module_spec(executable_file);
Status error;
- module = GetTarget().GetSharedModule(module_spec, &error);
+ module = GetTarget().GetOrCreateModule(module_spec,
+ true /* notify */, &error);
if (!module) {
return;
}
diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
index 1c7970564d8..21c9be552cf 100644
--- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -244,7 +244,8 @@ Status ProcessElfCore::DoLoadCore() {
exe_module_spec.GetFileSpec().SetFile(
m_nt_file_entries[0].path.GetCString(), FileSpec::Style::native);
if (exe_module_spec.GetFileSpec()) {
- exe_module_sp = GetTarget().GetSharedModule(exe_module_spec);
+ exe_module_sp = GetTarget().GetOrCreateModule(exe_module_spec,
+ true /* notify */);
if (exe_module_sp)
GetTarget().SetExecutableModule(exe_module_sp, eLoadDependentsNo);
}
diff --git a/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp b/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
index d6ab58c0f05..3da103b9064 100644
--- a/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
+++ b/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
@@ -388,7 +388,8 @@ void ProcessMinidump::ReadModuleList() {
Status error;
// Try and find a module with a full UUID that matches. This function will
// add the module to the target if it finds one.
- lldb::ModuleSP module_sp = GetTarget().GetSharedModule(module_spec, &error);
+ lldb::ModuleSP module_sp = GetTarget().GetOrCreateModule(module_spec,
+ true /* notify */, &error);
if (!module_sp) {
// Try and find a module without specifying the UUID and only looking for
// the file given a basename. We then will look for a partial UUID match
@@ -400,7 +401,8 @@ void ProcessMinidump::ReadModuleList() {
ModuleSpec basename_module_spec(module_spec);
basename_module_spec.GetUUID().Clear();
basename_module_spec.GetFileSpec().GetDirectory().Clear();
- module_sp = GetTarget().GetSharedModule(basename_module_spec, &error);
+ module_sp = GetTarget().GetOrCreateModule(basename_module_spec,
+ true /* notify */, &error);
if (module_sp) {
// We consider the module to be a match if the minidump UUID is a
// prefix of the actual UUID, or if either of the UUIDs are empty.
@@ -430,7 +432,7 @@ void ProcessMinidump::ReadModuleList() {
module_sp = Module::CreateModuleFromObjectFile<PlaceholderObjectFile>(
module_spec, module->base_of_image, module->size_of_image);
- GetTarget().GetImages().Append(module_sp);
+ GetTarget().GetImages().Append(module_sp, true /* notify */);
}
bool load_addr_changed = false;
OpenPOWER on IntegriCloud