[all-commits] [llvm/llvm-project] 63c77b: [lldb] Make persisting result variables configurable
Dave Lee via All-commits
all-commits at lists.llvm.org
Fri Feb 17 17:51:01 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 63c77bf71d80b24df377fc45c80bfa1904ee849e
https://github.com/llvm/llvm-project/commit/63c77bf71d80b24df377fc45c80bfa1904ee849e
Author: Dave Lee <davelee.com at gmail.com>
Date: 2023-02-17 (Fri, 17 Feb 2023)
Changed paths:
M lldb/source/Commands/CommandObjectDWIMPrint.cpp
M lldb/source/Commands/CommandObjectExpression.cpp
M lldb/source/Commands/CommandObjectExpression.h
M lldb/source/Commands/Options.td
M lldb/source/DataFormatters/ValueObjectPrinter.cpp
M lldb/test/API/commands/dwim-print/TestDWIMPrint.py
A lldb/test/API/commands/expression/persistent_result/Makefile
A lldb/test/API/commands/expression/persistent_result/TestPersistentResult.py
A lldb/test/API/commands/expression/persistent_result/main.c
Log Message:
-----------
[lldb] Make persisting result variables configurable
Context: The `expression` command uses artificial variables to store the expression
result. This result variable is unconditionally kept around after the expression command
has completed. These variables are known as persistent results. These are the variables
`$0`, `$1`, etc, that are displayed when running `p` or `expression`.
This change allows users to control whether result variables are persisted, by
introducing a `--persistent-result` flag.
This change keeps the current default behavior, persistent results are created by
default. This change gives users the ability to opt-out by re-aliasing `p`. For example:
```
command unalias p
command alias p expression --persistent-result false --
```
For consistency, this flag is also adopted by `dwim-print`. Of note, if asked,
`dwim-print` will create a persistent result even for frame variables.
Differential Revision: https://reviews.llvm.org/D144230
More information about the All-commits
mailing list