Skip to content

Commit 38d0bd2

Browse files
committed
[lldb] Fix crash in BreakpointSite::BumpHitCounts
Fix crash in BreakpointSite::BumpHitCounts due to missing synchronization. When bumping the hit count, we were correctly acquiring the constituents mutex, but didn't protect the breakpoint location collection. rdar://163760832
1 parent bd9030e commit 38d0bd2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lldb/include/lldb/Breakpoint/BreakpointLocationCollection.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,11 @@ class BreakpointLocationCollection {
179179
m_preserved_bps;
180180

181181
public:
182-
typedef llvm::iterator_range<collection::const_iterator>
182+
typedef LockingAdaptedIterable<std::mutex, collection>
183183
BreakpointLocationCollectionIterable;
184184
BreakpointLocationCollectionIterable BreakpointLocations() {
185-
return BreakpointLocationCollectionIterable(m_break_loc_collection);
185+
return BreakpointLocationCollectionIterable(m_break_loc_collection,
186+
m_collection_mutex);
186187
}
187188
};
188189
} // namespace lldb_private

0 commit comments

Comments
 (0)