jimingham wrote:
> > It's not clear that only SBValue.CreateValueFromExpression "creates values
> > from expressions"; after all SBTarget.EvaluateExpression and
> > SBFrame.EvaluateExpression also do that job. I think it's preferable for
> > the explicit EvaluateExpression API's to always run the expression parser -
> > so I agree with the decision you've made here. But I think the help string
> > for the setting needs to make that clearer.
>
> Should we maybe add the same functionality to those API calls, but with
> another setting that's disabled by default? So that if someone knows about
> DIL and would like to enable that, they could do it.
I'm not in favor of doing that as a behind-your-back setting. There are subtle
differences between the two approaches and we're not at the user level, where
"don't make me think too hard just do what's fast" is a reasonable offering.
And even on the command-line, you can easily choose whether to try DIL or not
by choosing `dwim-print` vrs. `expr`. It's only when you use `p` that the
choice gets a bit hidden and that's even more of a command-line user
convenience...
You could however add `{Get,Set}TryDILFirst` to the `SBExpressionOptions`,
however, if you think this is a useful feature. There's always a version of
EvaluteExpression that takes an `SBExpressionOptions`, and it shouldn't be any
hardship to have to use that overload if you want to try DIL expressions first.
Then people writing lldb Python can explicitly dial up which approach they
want.
>
> > We should probably also indicate this in the docs for
> > SBValue.CreateValueFromExpression, since you probably wouldn't find your
> > way to this detail otherwise.
>
> Added the docs, comments, and updated the description. Please check if they
> make sense.
https://github.com/llvm/llvm-project/pull/222192
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits