[Lldb-commits] [PATCH] D144937: [LLDB] Expose several methods in SBWatchpoint

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 28 12:42:11 PST 2023


jasonmolenda added a comment.

In D144937#4159324 <https://reviews.llvm.org/D144937#4159324>, @jasonmolenda wrote:

> In cases where we need to store additional information than a weak pointer to an lldb private object, we traditionally add an Impl class which has the additional member(s) and a shared pointer to the lldb private object that backs the class.  e.g. see SBValue's ValueImpl, the definition is in SBValue.cpp.

I was being a little sloppy in the ownership.  The SBValue has to keep the underlying ValueObject alive, so it has a shared pointer to its ValueImpl, which has a shared pointer to the ValueObject.  Running the SBValue dtor will decr the count on the ValueImpl causing it to be removed, and decrementing the ValueObjectSP count.

SBWatchpoint would use a shared pointer to its WatchpointImpl objct, and that would have a weak pointer to the lldb_private Watchpoint object; it is not responsible for keeping this watchpoint alive.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144937/new/

https://reviews.llvm.org/D144937



More information about the lldb-commits mailing list