summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint
diff options
context:
space:
mode:
authorEugene Zemtsov <ezemtsov@google.com>2018-04-16 22:26:21 +0000
committerEugene Zemtsov <ezemtsov@google.com>2018-04-16 22:26:21 +0000
commit9b294d1e905ab49c941333c81840afac9f6fe238 (patch)
tree2dbb3908040df7dd63464851684f309f2eb95206 /lldb/source/Breakpoint
parent17a47b915ab28f158dad485625c34db2bcc23821 (diff)
downloadbcm5719-llvm-9b294d1e905ab49c941333c81840afac9f6fe238.tar.gz
bcm5719-llvm-9b294d1e905ab49c941333c81840afac9f6fe238.zip
Make sure deleting all breakpoints clears their sites first
Bug: https://bugs.llvm.org/show_bug.cgi?id=36430 Differential Revision: https://reviews.llvm.org/D45554 llvm-svn: 330163
Diffstat (limited to 'lldb/source/Breakpoint')
-rw-r--r--lldb/source/Breakpoint/BreakpointList.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lldb/source/Breakpoint/BreakpointList.cpp b/lldb/source/Breakpoint/BreakpointList.cpp
index 01ac59f0a90..4a49b1e105a 100644
--- a/lldb/source/Breakpoint/BreakpointList.cpp
+++ b/lldb/source/Breakpoint/BreakpointList.cpp
@@ -99,7 +99,7 @@ void BreakpointList::RemoveAll(bool notify) {
void BreakpointList::RemoveAllowed(bool notify) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
-
+
bp_collection::iterator pos, end = m_breakpoints.end();
if (notify) {
for (pos = m_breakpoints.begin(); pos != end; ++pos) {
@@ -116,10 +116,12 @@ void BreakpointList::RemoveAllowed(bool notify) {
}
pos = m_breakpoints.begin();
while ( pos != end) {
- if((*pos)->AllowDelete())
- pos = m_breakpoints.erase(pos);
- else
- pos++;
+ auto bp = *pos;
+ if (bp->AllowDelete()) {
+ bp->ClearAllBreakpointSites();
+ pos = m_breakpoints.erase(pos);
+ } else
+ pos++;
}
}
OpenPOWER on IntegriCloud