diff options
author | Enrico Granata <egranata@apple.com> | 2012-11-08 02:22:02 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2012-11-08 02:22:02 +0000 |
commit | 1759848be00a5ab48ba5bccb70945b30c68da7f1 (patch) | |
tree | 75c6491edf772cba8614f2d67be5681e9d98b5a3 /lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp | |
parent | 489b5d645f370926894c88d8e5fd27f17aabff82 (diff) | |
download | bcm5719-llvm-1759848be00a5ab48ba5bccb70945b30c68da7f1.tar.gz bcm5719-llvm-1759848be00a5ab48ba5bccb70945b30c68da7f1.zip |
<rdar://problem/12586350>
This commit does three things:
(a) introduces a new notification model for adding/removing/changing modules to a ModuleList, and applies it to the Target's ModuleList, so that we make sure to always trigger the right set of actions
whenever modules come and go in a target. Certain spots in the code still need to "manually" notify the Target for several reasons, so this is a work in progress
(b) adds a new capability to the Platforms: locating a scripting resources associated to a module. A scripting resource is a Python file that can load commands, formatters, ... and any other action
of interest corresponding to the loading of a module. At the moment, this is only implemented on Mac OS X and only for files inside .dSYM bundles - the next step is going to be letting
the frameworks themselves hold their scripting resources. Implementors of platforms for other systems are free to implement "the right thing" for their own worlds
(c) hooking up items (a) and (b) so that targets auto-load the scripting resources as the corresponding modules get loaded in a target. This has a few caveats at the moment:
- the user needs to manually add the .py file to the dSYM (soon, it will also work in the framework itself)
- if two modules with the same name show up during the lifetime of an LLDB session, the second one won't be able to load its scripting resource, but will otherwise work just fine
llvm-svn: 167569
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp')
-rw-r--r-- | lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp index 1b9be627569..4723da8b184 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp @@ -287,7 +287,9 @@ DynamicLoaderMacOSXDYLD::FindTargetModuleForDYLDImageInfo (const DYLDImageInfo & { if (did_create_ptr) *did_create_ptr = false; - ModuleList &target_images = m_process->GetTarget().GetImages(); + + + const ModuleList &target_images = m_process->GetTarget().GetImages(); ModuleSpec module_spec (image_info.file_spec, image_info.GetArchitecture ()); module_spec.GetUUID() = image_info.uuid; ModuleSP module_sp (target_images.FindFirstModule (module_spec)); @@ -816,7 +818,7 @@ DynamicLoaderMacOSXDYLD::AddModulesUsingImageInfos (DYLDImageInfo::collection &i Section *commpage_section = sections->FindSectionByName(commpage_dbstr).get(); if (commpage_section) { - ModuleList& target_images = m_process->GetTarget().GetImages(); + const ModuleList& target_images = m_process->GetTarget().GetImages(); ModuleSpec module_spec (objfile->GetFileSpec(), image_infos[idx].GetArchitecture ()); module_spec.GetObjectName() = commpage_dbstr; ModuleSP commpage_image_module_sp(target_images.FindFirstModule (module_spec)); @@ -966,7 +968,7 @@ DynamicLoaderMacOSXDYLD::RemoveModulesUsingImageInfosAddress (lldb::addr_t image log->PutCString("Unloaded:"); unloaded_module_list.LogUUIDAndPaths (log, "DynamicLoaderMacOSXDYLD::ModulesDidUnload"); } - m_process->GetTarget().ModulesDidUnload (unloaded_module_list); + m_process->GetTarget().GetImages().Remove (unloaded_module_list); } m_dyld_image_infos_stop_id = m_process->GetStopID(); return true; @@ -1060,7 +1062,7 @@ DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos () // to an equivalent version. We don't want it to stay in the target's module list or it will confuse // us, so unload it here. Target &target = m_process->GetTarget(); - ModuleList &target_modules = target.GetImages(); + const ModuleList &target_modules = target.GetImages(); ModuleList not_loaded_modules; Mutex::Locker modules_locker(target_modules.GetMutex()); @@ -1082,7 +1084,7 @@ DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos () if (not_loaded_modules.GetSize() != 0) { - target.ModulesDidUnload(not_loaded_modules); + target.GetImages().Remove(not_loaded_modules); } return true; @@ -1586,7 +1588,7 @@ DynamicLoaderMacOSXDYLD::GetStepThroughTrampolinePlan (Thread &thread, bool stop { SymbolContextList target_symbols; TargetSP target_sp (thread.CalculateTarget()); - ModuleList &images = target_sp->GetImages(); + const ModuleList &images = target_sp->GetImages(); images.FindSymbolsWithNameAndType(trampoline_name, eSymbolTypeCode, target_symbols); |