summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-09-15 20:54:25 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-09-15 20:54:25 +0000
commitecb623a672a350a797b5fb4440717d2d4f902855 (patch)
tree0db858a848d29b5174f54130073982d16284b280 /lldb
parenteaa52652853241ab5d78c9db9c59ccad1f06c191 (diff)
downloadbcm5719-llvm-ecb623a672a350a797b5fb4440717d2d4f902855.tar.gz
bcm5719-llvm-ecb623a672a350a797b5fb4440717d2d4f902855.zip
Add cleanup of watchpoint locations during Target::DeleteCurrentProcess().
llvm-svn: 139840
Diffstat (limited to 'lldb')
-rw-r--r--lldb/include/lldb/Breakpoint/WatchpointLocationList.h3
-rw-r--r--lldb/source/Breakpoint/WatchpointLocationList.cpp10
-rw-r--r--lldb/source/Target/Target.cpp1
3 files changed, 14 insertions, 0 deletions
diff --git a/lldb/include/lldb/Breakpoint/WatchpointLocationList.h b/lldb/include/lldb/Breakpoint/WatchpointLocationList.h
index 74c8475ebd5..7afccefa3d8 100644
--- a/lldb/include/lldb/Breakpoint/WatchpointLocationList.h
+++ b/lldb/include/lldb/Breakpoint/WatchpointLocationList.h
@@ -174,6 +174,9 @@ public:
GetDescription (Stream *s,
lldb::DescriptionLevel level);
+ void
+ ClearAllWatchpointLocations ();
+
//------------------------------------------------------------------
/// Sets the passed in Locker to hold the Watchpoint Location List mutex.
///
diff --git a/lldb/source/Breakpoint/WatchpointLocationList.cpp b/lldb/source/Breakpoint/WatchpointLocationList.cpp
index d04c7d20bb4..b6c773ff94e 100644
--- a/lldb/source/Breakpoint/WatchpointLocationList.cpp
+++ b/lldb/source/Breakpoint/WatchpointLocationList.cpp
@@ -189,6 +189,16 @@ WatchpointLocationList::GetDescription (Stream *s, lldb::DescriptionLevel level)
}
void
+WatchpointLocationList::ClearAllWatchpointLocations ()
+{
+ Mutex::Locker locker(m_mutex);
+ addr_map::iterator pos, end = m_address_to_location.end();
+
+ for (pos = m_address_to_location.begin(); pos != end; ++pos)
+ m_address_to_location.erase(pos);
+}
+
+void
WatchpointLocationList::GetListMutex (Mutex::Locker &locker)
{
return locker.Reset (m_mutex.GetMutex());
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 607bb90b4cc..ca9e936b2bb 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -124,6 +124,7 @@ Target::DeleteCurrentProcess ()
// clean up needs some help from the process.
m_breakpoint_list.ClearAllBreakpointSites();
m_internal_breakpoint_list.ClearAllBreakpointSites();
+ m_watchpoint_location_list.ClearAllWatchpointLocations();
m_process_sp.reset();
}
}
OpenPOWER on IntegriCloud