[Lldb-commits] [PATCH] D74558: [lldb] Make shared_from_this-related code safer

Tatyana Krasnukha via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 13 07:12:14 PST 2020


tatyana-krasnukha created this revision.
tatyana-krasnukha added reviewers: JDevlieghere, teemperor.
tatyana-krasnukha added a project: LLDB.
Herald added subscribers: lldb-commits, abidh.

The idea is: the fewer classes make an assumption that a target object is already managed by a shared_ptr - the fewer ways to make a mistake.

Pass TargetSP to filters' CreateFromStructuredData, don't let them guess whether the target object is managed by a shared_ptr.

Make Breakpoint sure that m_target.shared_from_this() is safe by passing TargetSP to all its static Create*** member-functions.
This should be enough since Breakpoint's constructors are private/protected and never called directly (except by Target itself).

The patch is a consequence of D74556 <https://reviews.llvm.org/D74556>.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D74558

Files:
  lldb/include/lldb/Breakpoint/Breakpoint.h
  lldb/include/lldb/Core/SearchFilter.h
  lldb/source/Breakpoint/Breakpoint.cpp
  lldb/source/Core/SearchFilter.cpp
  lldb/source/Target/Target.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74558.244421.patch
Type: text/x-patch
Size: 11196 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200213/a30108ac/attachment.bin>


More information about the lldb-commits mailing list