In Microsoft Visual C++ 2015, how can I set a "Data Breakpoint" on a Boost shared pointer so that the debugger breaks whenever the number of strong and/or weak references changes?
Asked
Active
Viewed 602 times
1 Answers
2
The control block of a std::shared_ptr
in VS2015 has _Uses
and _Weaks
members. Just set data breakpoints to these through their watch expressions: e.g. &(*(ptr)._Rep)._Weaks
Here's a screenshot:

Martin Ba
- 37,187
- 33
- 183
- 337