[Lldb-commits] [PATCH] D47302: [lldb, lldb-mi] Add method AddCurrentTargetSharedObjectPath to the SBDebugger.

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 24 14:33:40 PDT 2018

clayborg added a comment.

In https://reviews.llvm.org/D47302#1111569, @polyakov.alex wrote:

> In https://reviews.llvm.org/D47302#1111497, @clayborg wrote:
> > no. Create a new SBTargetSettings class. SBTarget will hand one out for global and for target instance settings, Add all settings accessors to SBTargetSettings class
> What is a difference between `SBTargetSettings` and `TargetProperties` classes except API level?

Not much difference except everything in SBTargetSettings will need to be public C++ API safe (no virtual functions, one member variable in the class that is a pointer std::unique_ptr or std::shared_ptr, no inheritance, no STL in args or return values, no lldb_private classes in args or return values. For this class to be API safe, we will actually need to keep a shared pointer to the target properties. So the class in the API header will be something like:

  namespace lldb {
    SBTargetSettings {
      lldb::TargetPropertiesSP m_opaque_sp;

Then m_opaque_sp will be filled in by assiging from a TargetSP (since a shared pointer to a target can be converted to a TargetPropertiesSP since Target inherits from TargetProperties) or from a call to Target::GetGlobalProperties().



More information about the lldb-commits mailing list