[lldb] Add ability to hide the root name of a value
commit23349d83a98f23e67ff0321dad7c378b117ce6aa
authorDave Lee <davelee.com@gmail.com>
Fri, 24 Mar 2023 04:43:32 +0000 (23 21:43 -0700)
committerDave Lee <davelee.com@gmail.com>
Fri, 24 Mar 2023 21:07:31 +0000 (24 14:07 -0700)
treee92bde6c7ebd3e3e719e9126e91c4dfd2cfc53e6
parent9fee241122fdf0d8747f0922741bb1cae0c1c53a
[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
lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h
lldb/include/lldb/DataFormatters/ValueObjectPrinter.h
lldb/source/Commands/CommandObjectDWIMPrint.cpp
lldb/source/Commands/CommandObjectExpression.cpp
lldb/source/DataFormatters/DumpValueObjectOptions.cpp
lldb/source/DataFormatters/ValueObjectPrinter.cpp
lldb/test/API/commands/dwim-print/TestDWIMPrint.py
lldb/test/API/commands/dwim-print/main.c