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

Alexander Polyakov via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri May 25 11:58:35 PDT 2018

polyakov.alex added a comment.

In https://reviews.llvm.org/D47302#1111637, @clayborg wrote:

> 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 assigning 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(). And then we pass through all accessors we need.

If so, to do:


we need to cast our pointer to `TargetProperties` to a pointer to `Target` since there is no such property(manipulating with image search paths) in `TargetProperties` and then use Target's methods.



More information about the lldb-commits mailing list