[Lldb-commits] [PATCH] D55318: [Expressions] Add support of expressions evaluation in some object's context

Aleksandr Urakov via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 7 00:55:39 PST 2018

aleksandr.urakov marked 6 inline comments as done.
aleksandr.urakov added inline comments.

Comment at: include/lldb/Expression/UserExpression.h:296
+           lldb::ModuleSP *jit_module_sp_ptr = nullptr,
+           const lldb::ValueObjectSP &ctx_obj = lldb::ValueObjectSP());
zturner wrote:
> A reference to a `shared_ptr` seems odd.  Why don't we just say `const ValueObject* ctx_obj = nullptr`?
Yes, I agree. I wasn't sure about the lifetime of the context object, that's why I've used a shared pointer here. But now it is obvious that there should be no problems with the lifetime - an expression evaluation with a context object is called from `SBValue` only, so it is guaranteed that the required value exists during the evaluation.

The only thing is that the pointer points to a non-const value object - non-const methods are used.



More information about the lldb-commits mailing list