summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader/Static
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-05-30 02:19:25 +0000
committerJim Ingham <jingham@apple.com>2012-05-30 02:19:25 +0000
commit3ee12ef26ed534af3d0c85f88df7b06db037bfe3 (patch)
tree9d46961f3981c27e927926a4ea7d5a2c2b0b6ba7 /lldb/source/Plugins/DynamicLoader/Static
parent13586ab6d8a1c9f373315a70c384f67089c2371e (diff)
downloadbcm5719-llvm-3ee12ef26ed534af3d0c85f88df7b06db037bfe3.tar.gz
bcm5719-llvm-3ee12ef26ed534af3d0c85f88df7b06db037bfe3.zip
We were accessing the ModuleList in the target without locking it for tasks like
setting breakpoints. That's dangerous, since while we are setting a breakpoint, the target might hit the dyld load notification, and start removing modules from the list. This change adds a GetMutex accessor to the ModuleList class, and uses it whenever we are accessing the target's ModuleList (as returned by GetImages().) <rdar://problem/11552372> llvm-svn: 157668
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader/Static')
-rw-r--r--lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
index a1d64422e60..abfbf1c9ab6 100644
--- a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
@@ -97,10 +97,12 @@ DynamicLoaderStatic::LoadAllImagesAtFileAddresses ()
ModuleList loaded_module_list;
+ Mutex::Locker mutex_locker(module_list.GetMutex());
+
const size_t num_modules = module_list.GetSize();
for (uint32_t idx = 0; idx < num_modules; ++idx)
{
- ModuleSP module_sp (module_list.GetModuleAtIndex (idx));
+ ModuleSP module_sp (module_list.GetModuleAtIndexUnlocked (idx));
if (module_sp)
{
bool changed = false;
OpenPOWER on IntegriCloud