[Lldb-commits] [lldb] [LLDB] Add user documentation for DIL. (PR #228275)
Ilia Kuklin via lldb-commits
lldb-commits at lists.llvm.org
Fri Oct 2 09:01:21 PDT 2026
https://github.com/kuilpd commented:
Maybe this needs to be re-structured and cut down a bit. I feel like starting with the background and motivation, and explaining how different DIL applications came to be works great as a presentation, but not documentation. If I understand the purpose of this document correctly, we want people to be able to refer to it to quickly understand what DIL is and how to use it (correct me if I'm wrong about this). The less text, the more likely it will be read.
I'd suggest this structure:
1. Quick introduction of what DIL is. Basically first paragraph of `DIL: The Data Inspection Language` and `What is DIL and why did we implement it?` + speed and stability.
2. What can DIL do: `The DIL Language` section entirely. I would also add `CAUTION: DIL vs. Expression Evaluator` here, but very short, distilled to 2 key differences: DIL doesn't use overloaded operators, and DIL uses dynamic values and synthnetic providers.
3. How to use DIL (without extra explanations why are things the way they are, just straight to the point):
- DIL is called in `StackFrame::GetValueForVariableExpressionPath`, which is used internally in LLDB. The setting `target.experimental.use-DIL` that can switch this function to the old frame var implementation. Note that this setting also reverts `frame var` and API calls to the old implementation because they all eventually call `StackFrame::GetValueForVariableExpressionPath`.
- `frame var` command
- Direct API call `SBFrame::GetValueForVariablePath`
- Breakpoint conditions and how to control it with `target.breakpoints-condition-mode` setting, command line option -Z, API calls `SBBreakpoint::Set/GetConditionMode`.
- API `SBValue::CreateValueFromExpressions` and how to control with `target.experimental.use-DIL-for-creating-values`, and `SBExpressionOptions::TryDILFirst`.
- "DIL can also work in different modes" - list DIL modes and `SBFrame::GetValueForVariablePathWithMode`, and add that all of the above functionality uses Full mode. Optionally (here or even better below, somewhere in background) we can list `dwim-print` and 2 calls in `lldb-dap` that use DIL in other modes and that they are the reason why modes exist to begin with, which is to preserve the old behavior so that their functionality doesn't change if DIL is enabled.
4. Verbose `DIL vs. Expression Evaluator` section
5. Background and motivation, for those who are interested beyond how to use it.
https://github.com/llvm/llvm-project/pull/228275
More information about the lldb-commits
mailing list