Add cleanup of watchpoint locations during Target::DeleteCurrentProcess().

llvm-svn: 139840
This commit is contained in:
Johnny Chen
2011-09-15 20:54:25 +00:00
parent eaa5265285
commit ecb623a672
3 changed files with 14 additions and 0 deletions

View File

@@ -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.
///

View File

@@ -188,6 +188,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)
{

View File

@@ -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();
}
}