aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectExpression.h
diff options
context:
space:
mode:
authorDave Lee <davelee.com@gmail.com>2023-02-16 15:39:09 -0800
committerDave Lee <davelee.com@gmail.com>2023-02-17 17:50:43 -0800
commit63c77bf71d80b24df377fc45c80bfa1904ee849e (patch)
tree6673480f178c18dcc743b1f61183a8eead4724a8 /lldb/source/Commands/CommandObjectExpression.h
parent920b46e108b23454e6827ed0fa5e0a69fcb4a6e6 (diff)
downloadllvm-63c77bf71d80b24df377fc45c80bfa1904ee849e.zip
llvm-63c77bf71d80b24df377fc45c80bfa1904ee849e.tar.gz
llvm-63c77bf71d80b24df377fc45c80bfa1904ee849e.tar.bz2
[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
Diffstat (limited to 'lldb/source/Commands/CommandObjectExpression.h')
-rw-r--r--lldb/source/Commands/CommandObjectExpression.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.h b/lldb/source/Commands/CommandObjectExpression.h
index bcd76f8..e381a4a 100644
--- a/lldb/source/Commands/CommandObjectExpression.h
+++ b/lldb/source/Commands/CommandObjectExpression.h
@@ -53,6 +53,7 @@ public:
lldb::LanguageType language;
LanguageRuntimeDescriptionDisplayVerbosity m_verbosity;
LazyBool auto_apply_fixits;
+ bool suppress_persistent_result;
};
CommandObjectExpression(CommandInterpreter &interpreter);