summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ModuleList.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-05-17 18:38:42 +0000
committerJim Ingham <jingham@apple.com>2012-05-17 18:38:42 +0000
commit4a94c91077a17d790956a6bfcf2e171b00bae100 (patch)
treee7b27ef322b77138115d8d8c0b8ca86fa2affe6b /lldb/source/Core/ModuleList.cpp
parent276a3e8c4635a0b5cb9a2252f3fd3e20b5c79cbb (diff)
downloadbcm5719-llvm-4a94c91077a17d790956a6bfcf2e171b00bae100.tar.gz
bcm5719-llvm-4a94c91077a17d790956a6bfcf2e171b00bae100.zip
If we notice that a module with a given file path is replaced by another with the same file
path on rerunning, evict the old module from the target module list, inform the breakpoints about this so they can do something intelligent as well. rdar://problem/11273043 llvm-svn: 157008
Diffstat (limited to 'lldb/source/Core/ModuleList.cpp')
-rw-r--r--lldb/source/Core/ModuleList.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp
index c5a89554c62..8f852d4d8d1 100644
--- a/lldb/source/Core/ModuleList.cpp
+++ b/lldb/source/Core/ModuleList.cpp
@@ -110,6 +110,29 @@ ModuleList::Remove (const ModuleSP &module_sp)
return false;
}
+bool
+ModuleList::RemoveIfOrphaned (const Module *module_ptr)
+{
+ if (module_ptr)
+ {
+ Mutex::Locker locker(m_modules_mutex);
+ collection::iterator pos, end = m_modules.end();
+ for (pos = m_modules.begin(); pos != end; ++pos)
+ {
+ if (pos->get() == module_ptr)
+ {
+ if (pos->unique())
+ {
+ pos = m_modules.erase (pos);
+ return true;
+ }
+ else
+ return false;
+ }
+ }
+ }
+ return false;
+}
size_t
ModuleList::RemoveOrphans (bool mandatory)
@@ -817,4 +840,10 @@ ModuleList::RemoveSharedModule (lldb::ModuleSP &module_sp)
return GetSharedModuleList ().Remove (module_sp);
}
+bool
+ModuleList::RemoveSharedModuleIfOrphaned (const Module *module_ptr)
+{
+ return GetSharedModuleList ().RemoveIfOrphaned (module_ptr);
+}
+
OpenPOWER on IntegriCloud