[Lldb-commits] [lldb] [lldb] Note Command Used For DWIM Printing Of Persistent Variable (PR #215650)

Will Hawkins via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 11 15:08:26 PDT 2026


hawkinsw wrote:

> Given that the DWIM-print philosophy is to look up everything it can as a simple lookup, and only falling back on the expression evaluator if it has to, checking that identifiers are in the persistent expression store before falling back to actually running the expression evaluator is the more consistent way to do this.

Just curious, but it seems like 

```C++
if (frame && try_variable_path) {
    VariableSP var_sp;
    Status status;
    auto valobj_sp = frame->GetValueForVariableExpressionPath(
        expr, eval_options.GetUseDynamic(),
        StackFrame::eExpressionPathOptionsAllowDirectIVarAccess |
            StackFrame::eExpressionPathOptionsDisallowGlobals,
        var_sp, status, lldb::eDILModeSimple);
    if (valobj_sp && status.Success() && valobj_sp->GetError().Success()) {
```

does an evaluation, although in a limited context where the effect of the evaluation may be no more powerful than a lookup. Is that consistent with the "DWIM-print philosophy is to look up everything"? I'm just trying to make sure that I understand!

https://github.com/llvm/llvm-project/pull/215650


More information about the lldb-commits mailing list