diff options
author | Dave Lee <davelee.com@gmail.com> | 2023-03-23 21:43:32 -0700 |
---|---|---|
committer | Dave Lee <davelee.com@gmail.com> | 2023-03-24 14:07:31 -0700 |
commit | 23349d83a98f23e67ff0321dad7c378b117ce6aa (patch) | |
tree | e92bde6c7ebd3e3e719e9126e91c4dfd2cfc53e6 /lldb/source/Commands | |
parent | 9fee241122fdf0d8747f0922741bb1cae0c1c53a (diff) | |
download | llvm-23349d83a98f23e67ff0321dad7c378b117ce6aa.zip llvm-23349d83a98f23e67ff0321dad7c378b117ce6aa.tar.gz llvm-23349d83a98f23e67ff0321dad7c378b117ce6aa.tar.bz2 |
[lldb] Add ability to hide the root name of a value
When printing a value, allow the root value's name to be elided, without omiting the
names of child values.
At the API level, this adds `SetHideRootName()`, which joins the existing
`SetHideName()` function.
This functionality is used by `dwim-print` and `expression`.
Fixes an issue identified by @jgorbe in https://reviews.llvm.org/D145609.
Differential Revision: https://reviews.llvm.org/D146783
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r-- | lldb/source/Commands/CommandObjectDWIMPrint.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectExpression.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectDWIMPrint.cpp b/lldb/source/Commands/CommandObjectDWIMPrint.cpp index ed81619..0b5dde9 100644 --- a/lldb/source/Commands/CommandObjectDWIMPrint.cpp +++ b/lldb/source/Commands/CommandObjectDWIMPrint.cpp @@ -88,7 +88,7 @@ bool CommandObjectDWIMPrint::DoExecute(StringRef command, DumpValueObjectOptions dump_options = m_varobj_options.GetAsDumpOptions( m_expr_options.m_verbosity, m_format_options.GetFormat()); - dump_options.SetHideName(eval_options.GetSuppressPersistentResult()); + dump_options.SetHideRootName(eval_options.GetSuppressPersistentResult()); // First, try `expr` as the name of a frame variable. if (StackFrame *frame = m_exe_ctx.GetFramePtr()) { diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index 2658677..5d68f66 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -456,7 +456,7 @@ bool CommandObjectExpression::EvaluateExpression(llvm::StringRef expr, DumpValueObjectOptions options(m_varobj_options.GetAsDumpOptions( m_command_options.m_verbosity, format)); - options.SetHideName(eval_options.GetSuppressPersistentResult()); + options.SetHideRootName(eval_options.GetSuppressPersistentResult()); options.SetVariableFormatDisplayLanguage( result_valobj_sp->GetPreferredDisplayLanguage()); |