[lldb][NFC] Fix all formatting errors in .cpp file headers
Summary:
A *.cpp file header in LLDB (and in LLDB) should like this:
```
//===-- TestUtilities.cpp -------------------------------------------------===//
```
However in LLDB most of our source files have arbitrary changes to this format and
these changes are spreading through LLDB as folks usually just use the existing
source files as templates for their new files (most notably the unnecessary
editor language indicator `-*- C++ -*-` is spreading and in every review
someone is pointing out that this is wrong, resulting in people pointing out that this
is done in the same way in other files).
This patch removes most of these inconsistencies including the editor language indicators,
all the different missing/additional '-' characters, files that center the file name, missing
trailing `===//` (mostly caused by clang-format breaking the line).
Reviewers: aprantl, espindola, jfb, shafik, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: dexonsmith, wuzish, emaste, sdardis, nemanjai, kbarton, MaskRay, atanasyan, arphaman, jfb, abidh, jsji, JDevlieghere, usaxena95, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73258
2020-01-24 15:23:27 +08:00
|
|
|
//===-- OptionGroupValueObjectDisplay.cpp ---------------------------------===//
|
2011-04-28 06:04:39 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2011-04-28 06:04:39 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2011-05-14 04:21:08 +08:00
|
|
|
#include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
|
2011-04-28 06:04:39 +08:00
|
|
|
|
<rdar://problem/14393032>
DumpValueObject() 2.0
This checkin restores pre-Xcode5 functionality to the "po" (expr -O) command:
- expr now has a new --description-verbosity (-v) argument, which takes either compact or full as a value (-v is the same as -vfull)
When the full mode is on, "po" will show the extended output with type name, persistent variable name and value, as in
(lldb) expr -O -v -- foo
(id) $0 = 0x000000010010baf0 {
1 = 2;
2 = 3;
}
When -v is omitted, or -vcompact is passed, the Xcode5-style output will be shown, as in
(lldb) expr -O -- foo
{
1 = 2;
2 = 3;
}
- for a non-ObjectiveC object, LLDB will still try to retrieve a summary and/or value to display
(lldb) po 5
5
-v also works in this mode
(lldb) expr -O -vfull -- 5
(int) $4 = 5
On top of that, this is a major refactoring of the ValueObject printing code. The functionality is now factored into a ValueObjectPrinter class for easier maintenance in the future
DumpValueObject() was turned into an instance method ValueObject::Dump() which simply calls through to the printer code, Dump_Impl has been removed
Test case to follow
llvm-svn: 191694
2013-10-01 03:11:51 +08:00
|
|
|
#include "lldb/DataFormatters/ValueObjectPrinter.h"
|
2017-03-23 07:33:16 +08:00
|
|
|
#include "lldb/Host/OptionParser.h"
|
2011-05-04 11:43:18 +08:00
|
|
|
#include "lldb/Interpreter/CommandInterpreter.h"
|
2018-04-10 17:03:59 +08:00
|
|
|
#include "lldb/Interpreter/OptionArgParser.h"
|
2011-05-04 11:43:18 +08:00
|
|
|
#include "lldb/Target/Target.h"
|
2011-04-28 06:04:39 +08:00
|
|
|
|
Convert option tables to ArrayRefs.
This change is very mechanical. All it does is change the
signature of `Options::GetDefinitions()` and `OptionGroup::
GetDefinitions()` to return an `ArrayRef<OptionDefinition>`
instead of a `const OptionDefinition *`. In the case of the
former, it deletes the sentinel entry from every table, and
in the case of the latter, it removes the `GetNumDefinitions()`
method from the interface. These are no longer necessary as
`ArrayRef` carries its own length.
In the former case, iteration was done by using a sentinel
entry, so there was no knowledge of length. Because of this
the individual option tables were allowed to be defined below
the corresponding class (after all, only a pointer was needed).
Now, however, the length must be known at compile time to
construct the `ArrayRef`, and as a result it is necessary to
move every option table before its corresponding class. This
results in this CL looking very big, but in terms of substance
there is not much here.
Differential revision: https://reviews.llvm.org/D24834
llvm-svn: 282188
2016-09-23 04:22:55 +08:00
|
|
|
#include "llvm/ADT/ArrayRef.h"
|
|
|
|
|
2011-04-28 06:04:39 +08:00
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
2018-09-27 02:50:19 +08:00
|
|
|
static const OptionDefinition g_option_table[] = {
|
2014-07-10 00:31:49 +08:00
|
|
|
{LLDB_OPT_SET_1, false, "dynamic-type", 'd',
|
2018-09-27 02:50:19 +08:00
|
|
|
OptionParser::eRequiredArgument, nullptr, GetDynamicValueTypes(), 0,
|
2014-07-10 00:31:49 +08:00
|
|
|
eArgTypeNone, "Show the object as its full dynamic type, not its static "
|
|
|
|
"type, if available."},
|
|
|
|
{LLDB_OPT_SET_1, false, "synthetic-type", 'S',
|
2018-09-27 02:50:19 +08:00
|
|
|
OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeBoolean,
|
2014-07-10 00:31:49 +08:00
|
|
|
"Show the object obeying its synthetic provider, if available."},
|
|
|
|
{LLDB_OPT_SET_1, false, "depth", 'D', OptionParser::eRequiredArgument,
|
2018-09-27 02:50:19 +08:00
|
|
|
nullptr, {}, 0, eArgTypeCount, "Set the max recurse depth when dumping "
|
|
|
|
"aggregate types (default is infinity)."},
|
2014-07-10 00:31:49 +08:00
|
|
|
{LLDB_OPT_SET_1, false, "flat", 'F', OptionParser::eNoArgument, nullptr,
|
2018-09-27 02:50:19 +08:00
|
|
|
{}, 0, eArgTypeNone, "Display results in a flat format that uses "
|
|
|
|
"expression paths for each variable or member."},
|
2014-07-10 00:31:49 +08:00
|
|
|
{LLDB_OPT_SET_1, false, "location", 'L', OptionParser::eNoArgument, nullptr,
|
2018-09-27 02:50:19 +08:00
|
|
|
{}, 0, eArgTypeNone, "Show variable location information."},
|
2014-07-10 00:31:49 +08:00
|
|
|
{LLDB_OPT_SET_1, false, "object-description", 'O',
|
2018-09-27 02:50:19 +08:00
|
|
|
OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone,
|
2019-10-30 04:05:56 +08:00
|
|
|
"Display using a language-specific description API, if possible."},
|
2014-07-10 00:31:49 +08:00
|
|
|
{LLDB_OPT_SET_1, false, "ptr-depth", 'P', OptionParser::eRequiredArgument,
|
2018-09-27 02:50:19 +08:00
|
|
|
nullptr, {}, 0, eArgTypeCount, "The number of pointers to be traversed "
|
|
|
|
"when dumping values (default is zero)."},
|
2014-07-10 00:31:49 +08:00
|
|
|
{LLDB_OPT_SET_1, false, "show-types", 'T', OptionParser::eNoArgument,
|
2018-09-27 02:50:19 +08:00
|
|
|
nullptr, {}, 0, eArgTypeNone,
|
2014-07-10 00:31:49 +08:00
|
|
|
"Show variable types when dumping values."},
|
|
|
|
{LLDB_OPT_SET_1, false, "no-summary-depth", 'Y',
|
2018-09-27 02:50:19 +08:00
|
|
|
OptionParser::eOptionalArgument, nullptr, {}, 0, eArgTypeCount,
|
2011-04-28 06:04:39 +08:00
|
|
|
"Set the depth at which omitting summary information stops (default is "
|
2016-09-07 04:57:50 +08:00
|
|
|
"1)."},
|
2014-07-10 00:31:49 +08:00
|
|
|
{LLDB_OPT_SET_1, false, "raw-output", 'R', OptionParser::eNoArgument,
|
2018-09-27 02:50:19 +08:00
|
|
|
nullptr, {}, 0, eArgTypeNone, "Don't use formatting options."},
|
2014-07-10 00:31:49 +08:00
|
|
|
{LLDB_OPT_SET_1, false, "show-all-children", 'A', OptionParser::eNoArgument,
|
2018-09-27 02:50:19 +08:00
|
|
|
nullptr, {}, 0, eArgTypeNone,
|
2014-07-10 00:31:49 +08:00
|
|
|
"Ignore the upper bound on the number of children to show."},
|
2016-04-25 08:52:47 +08:00
|
|
|
{LLDB_OPT_SET_1, false, "validate", 'V', OptionParser::eRequiredArgument,
|
2018-09-27 02:50:19 +08:00
|
|
|
nullptr, {}, 0, eArgTypeBoolean, "Show results of type validators."},
|
2016-04-25 08:52:47 +08:00
|
|
|
{LLDB_OPT_SET_1, false, "element-count", 'Z',
|
2018-09-27 02:50:19 +08:00
|
|
|
OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeCount,
|
2016-04-25 08:52:47 +08:00
|
|
|
"Treat the result of the expression as if its type is an array of this "
|
Convert option tables to ArrayRefs.
This change is very mechanical. All it does is change the
signature of `Options::GetDefinitions()` and `OptionGroup::
GetDefinitions()` to return an `ArrayRef<OptionDefinition>`
instead of a `const OptionDefinition *`. In the case of the
former, it deletes the sentinel entry from every table, and
in the case of the latter, it removes the `GetNumDefinitions()`
method from the interface. These are no longer necessary as
`ArrayRef` carries its own length.
In the former case, iteration was done by using a sentinel
entry, so there was no knowledge of length. Because of this
the individual option tables were allowed to be defined below
the corresponding class (after all, only a pointer was needed).
Now, however, the length must be known at compile time to
construct the `ArrayRef`, and as a result it is necessary to
move every option table before its corresponding class. This
results in this CL looking very big, but in terms of substance
there is not much here.
Differential revision: https://reviews.llvm.org/D24834
llvm-svn: 282188
2016-09-23 04:22:55 +08:00
|
|
|
"many values."}};
|
2011-04-28 06:04:39 +08:00
|
|
|
|
Convert option tables to ArrayRefs.
This change is very mechanical. All it does is change the
signature of `Options::GetDefinitions()` and `OptionGroup::
GetDefinitions()` to return an `ArrayRef<OptionDefinition>`
instead of a `const OptionDefinition *`. In the case of the
former, it deletes the sentinel entry from every table, and
in the case of the latter, it removes the `GetNumDefinitions()`
method from the interface. These are no longer necessary as
`ArrayRef` carries its own length.
In the former case, iteration was done by using a sentinel
entry, so there was no knowledge of length. Because of this
the individual option tables were allowed to be defined below
the corresponding class (after all, only a pointer was needed).
Now, however, the length must be known at compile time to
construct the `ArrayRef`, and as a result it is necessary to
move every option table before its corresponding class. This
results in this CL looking very big, but in terms of substance
there is not much here.
Differential revision: https://reviews.llvm.org/D24834
llvm-svn: 282188
2016-09-23 04:22:55 +08:00
|
|
|
llvm::ArrayRef<OptionDefinition>
|
|
|
|
OptionGroupValueObjectDisplay::GetDefinitions() {
|
2016-09-23 05:06:13 +08:00
|
|
|
return llvm::makeArrayRef(g_option_table);
|
2011-04-28 06:04:39 +08:00
|
|
|
}
|
|
|
|
|
2017-05-12 12:51:55 +08:00
|
|
|
Status OptionGroupValueObjectDisplay::SetOptionValue(
|
2016-09-24 01:48:13 +08:00
|
|
|
uint32_t option_idx, llvm::StringRef option_arg,
|
2016-08-12 07:51:28 +08:00
|
|
|
ExecutionContext *execution_context) {
|
2017-05-12 12:51:55 +08:00
|
|
|
Status error;
|
2012-12-04 08:32:51 +08:00
|
|
|
const int short_option = g_option_table[option_idx].short_option;
|
2011-04-28 06:04:39 +08:00
|
|
|
bool success = false;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2011-04-28 06:04:39 +08:00
|
|
|
switch (short_option) {
|
|
|
|
case 'd': {
|
2011-05-04 11:43:18 +08:00
|
|
|
int32_t result;
|
2018-09-27 02:50:19 +08:00
|
|
|
result = OptionArgParser::ToOptionEnum(option_arg, GetDynamicValueTypes(),
|
|
|
|
2, error);
|
2012-08-23 01:17:09 +08:00
|
|
|
if (error.Success())
|
|
|
|
use_dynamic = (lldb::DynamicValueType)result;
|
2011-05-04 11:43:18 +08:00
|
|
|
} break;
|
|
|
|
case 'T':
|
|
|
|
show_types = true;
|
|
|
|
break;
|
2011-04-28 06:04:39 +08:00
|
|
|
case 'L':
|
|
|
|
show_location = true;
|
|
|
|
break;
|
|
|
|
case 'F':
|
|
|
|
flat_output = true;
|
|
|
|
break;
|
2011-08-10 07:50:01 +08:00
|
|
|
case 'O':
|
|
|
|
use_objc = true;
|
|
|
|
break;
|
|
|
|
case 'R':
|
|
|
|
be_raw = true;
|
|
|
|
break;
|
2011-08-12 10:00:06 +08:00
|
|
|
case 'A':
|
|
|
|
ignore_cap = true;
|
|
|
|
break;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2011-04-29 04:55:26 +08:00
|
|
|
case 'D':
|
2016-09-24 01:48:13 +08:00
|
|
|
if (option_arg.getAsInteger(0, max_depth)) {
|
|
|
|
max_depth = UINT32_MAX;
|
|
|
|
error.SetErrorStringWithFormat("invalid max depth '%s'",
|
|
|
|
option_arg.str().c_str());
|
2022-04-27 07:34:10 +08:00
|
|
|
} else {
|
|
|
|
max_depth_is_default = false;
|
2016-09-24 01:48:13 +08:00
|
|
|
}
|
2011-04-28 06:04:39 +08:00
|
|
|
break;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-04-25 08:52:47 +08:00
|
|
|
case 'Z':
|
2016-09-24 01:48:13 +08:00
|
|
|
if (option_arg.getAsInteger(0, elem_count)) {
|
|
|
|
elem_count = UINT32_MAX;
|
|
|
|
error.SetErrorStringWithFormat("invalid element count '%s'",
|
|
|
|
option_arg.str().c_str());
|
|
|
|
}
|
2016-04-25 08:52:47 +08:00
|
|
|
break;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2011-04-29 04:55:26 +08:00
|
|
|
case 'P':
|
2016-09-24 01:48:13 +08:00
|
|
|
if (option_arg.getAsInteger(0, ptr_depth)) {
|
|
|
|
ptr_depth = 0;
|
|
|
|
error.SetErrorStringWithFormat("invalid pointer depth '%s'",
|
|
|
|
option_arg.str().c_str());
|
|
|
|
}
|
2011-04-28 06:04:39 +08:00
|
|
|
break;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2011-07-16 09:22:04 +08:00
|
|
|
case 'Y':
|
2016-09-24 02:11:03 +08:00
|
|
|
if (option_arg.empty())
|
|
|
|
no_summary_depth = 1;
|
|
|
|
else if (option_arg.getAsInteger(0, no_summary_depth)) {
|
2016-09-24 02:13:18 +08:00
|
|
|
no_summary_depth = 0;
|
2016-09-24 01:48:13 +08:00
|
|
|
error.SetErrorStringWithFormat("invalid pointer depth '%s'",
|
|
|
|
option_arg.str().c_str());
|
|
|
|
}
|
2011-07-16 09:22:04 +08:00
|
|
|
break;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2011-07-22 08:16:08 +08:00
|
|
|
case 'S':
|
2018-04-10 17:03:59 +08:00
|
|
|
use_synth = OptionArgParser::ToBoolean(option_arg, true, &success);
|
2011-07-22 08:16:08 +08:00
|
|
|
if (!success)
|
2016-09-24 01:48:13 +08:00
|
|
|
error.SetErrorStringWithFormat("invalid synthetic-type '%s'",
|
|
|
|
option_arg.str().c_str());
|
2011-07-22 08:16:08 +08:00
|
|
|
break;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2014-09-06 10:20:19 +08:00
|
|
|
case 'V':
|
2018-04-10 17:03:59 +08:00
|
|
|
run_validator = OptionArgParser::ToBoolean(option_arg, true, &success);
|
2014-09-06 10:20:19 +08:00
|
|
|
if (!success)
|
2016-09-24 01:48:13 +08:00
|
|
|
error.SetErrorStringWithFormat("invalid validate '%s'",
|
|
|
|
option_arg.str().c_str());
|
2014-09-06 10:20:19 +08:00
|
|
|
break;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2011-04-28 06:04:39 +08:00
|
|
|
default:
|
2019-08-22 16:08:05 +08:00
|
|
|
llvm_unreachable("Unimplemented option");
|
2011-04-28 06:04:39 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2011-04-28 06:04:39 +08:00
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
2016-08-12 07:51:28 +08:00
|
|
|
void OptionGroupValueObjectDisplay::OptionParsingStarting(
|
|
|
|
ExecutionContext *execution_context) {
|
2011-10-26 12:32:38 +08:00
|
|
|
// If these defaults change, be sure to modify AnyOptionWasSet().
|
2011-07-16 09:22:04 +08:00
|
|
|
show_types = false;
|
|
|
|
no_summary_depth = 0;
|
|
|
|
show_location = false;
|
|
|
|
flat_output = false;
|
|
|
|
use_objc = false;
|
|
|
|
max_depth = UINT32_MAX;
|
2022-04-27 07:34:10 +08:00
|
|
|
max_depth_is_default = true;
|
2011-07-16 09:22:04 +08:00
|
|
|
ptr_depth = 0;
|
2016-04-25 08:52:47 +08:00
|
|
|
elem_count = 0;
|
2011-07-22 08:16:08 +08:00
|
|
|
use_synth = true;
|
2011-08-10 07:50:01 +08:00
|
|
|
be_raw = false;
|
2011-08-12 10:00:06 +08:00
|
|
|
ignore_cap = false;
|
2014-09-06 10:20:19 +08:00
|
|
|
run_validator = false;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-08-12 07:51:28 +08:00
|
|
|
TargetSP target_sp =
|
|
|
|
execution_context ? execution_context->GetTargetSP() : TargetSP();
|
2022-04-27 07:34:10 +08:00
|
|
|
if (target_sp) {
|
2016-08-12 07:51:28 +08:00
|
|
|
use_dynamic = target_sp->GetPreferDynamicValue();
|
2022-04-27 07:34:10 +08:00
|
|
|
auto max_depth_config = target_sp->GetMaximumDepthOfChildrenToDisplay();
|
|
|
|
max_depth = std::get<uint32_t>(max_depth_config);
|
|
|
|
max_depth_is_default = std::get<bool>(max_depth_config);
|
|
|
|
} else {
|
2011-05-04 11:43:18 +08:00
|
|
|
// If we don't have any targets, then dynamic values won't do us much good.
|
|
|
|
use_dynamic = lldb::eNoDynamicValues;
|
|
|
|
}
|
2011-05-14 04:21:08 +08:00
|
|
|
}
|
2013-03-27 02:04:53 +08:00
|
|
|
|
<rdar://problem/14393032>
DumpValueObject() 2.0
This checkin restores pre-Xcode5 functionality to the "po" (expr -O) command:
- expr now has a new --description-verbosity (-v) argument, which takes either compact or full as a value (-v is the same as -vfull)
When the full mode is on, "po" will show the extended output with type name, persistent variable name and value, as in
(lldb) expr -O -v -- foo
(id) $0 = 0x000000010010baf0 {
1 = 2;
2 = 3;
}
When -v is omitted, or -vcompact is passed, the Xcode5-style output will be shown, as in
(lldb) expr -O -- foo
{
1 = 2;
2 = 3;
}
- for a non-ObjectiveC object, LLDB will still try to retrieve a summary and/or value to display
(lldb) po 5
5
-v also works in this mode
(lldb) expr -O -vfull -- 5
(int) $4 = 5
On top of that, this is a major refactoring of the ValueObject printing code. The functionality is now factored into a ValueObjectPrinter class for easier maintenance in the future
DumpValueObject() was turned into an instance method ValueObject::Dump() which simply calls through to the printer code, Dump_Impl has been removed
Test case to follow
llvm-svn: 191694
2013-10-01 03:11:51 +08:00
|
|
|
DumpValueObjectOptions OptionGroupValueObjectDisplay::GetAsDumpOptions(
|
|
|
|
LanguageRuntimeDescriptionDisplayVerbosity lang_descr_verbosity,
|
2013-03-27 02:04:53 +08:00
|
|
|
lldb::Format format, lldb::TypeSummaryImplSP summary_sp) {
|
<rdar://problem/14393032>
DumpValueObject() 2.0
This checkin restores pre-Xcode5 functionality to the "po" (expr -O) command:
- expr now has a new --description-verbosity (-v) argument, which takes either compact or full as a value (-v is the same as -vfull)
When the full mode is on, "po" will show the extended output with type name, persistent variable name and value, as in
(lldb) expr -O -v -- foo
(id) $0 = 0x000000010010baf0 {
1 = 2;
2 = 3;
}
When -v is omitted, or -vcompact is passed, the Xcode5-style output will be shown, as in
(lldb) expr -O -- foo
{
1 = 2;
2 = 3;
}
- for a non-ObjectiveC object, LLDB will still try to retrieve a summary and/or value to display
(lldb) po 5
5
-v also works in this mode
(lldb) expr -O -vfull -- 5
(int) $4 = 5
On top of that, this is a major refactoring of the ValueObject printing code. The functionality is now factored into a ValueObjectPrinter class for easier maintenance in the future
DumpValueObject() was turned into an instance method ValueObject::Dump() which simply calls through to the printer code, Dump_Impl has been removed
Test case to follow
llvm-svn: 191694
2013-10-01 03:11:51 +08:00
|
|
|
DumpValueObjectOptions options;
|
2015-07-28 02:34:14 +08:00
|
|
|
options.SetMaximumPointerDepth(
|
|
|
|
{DumpValueObjectOptions::PointerDepth::Mode::Always, ptr_depth});
|
2013-03-27 02:04:53 +08:00
|
|
|
if (use_objc)
|
|
|
|
options.SetShowSummary(false);
|
|
|
|
else
|
|
|
|
options.SetOmitSummaryDepth(no_summary_depth);
|
2022-04-27 07:34:10 +08:00
|
|
|
options.SetMaximumDepth(max_depth, max_depth_is_default)
|
2013-03-27 02:04:53 +08:00
|
|
|
.SetShowTypes(show_types)
|
|
|
|
.SetShowLocation(show_location)
|
|
|
|
.SetUseObjectiveC(use_objc)
|
|
|
|
.SetUseDynamicType(use_dynamic)
|
|
|
|
.SetUseSyntheticValue(use_synth)
|
|
|
|
.SetFlatOutput(flat_output)
|
|
|
|
.SetIgnoreCap(ignore_cap)
|
|
|
|
.SetFormat(format)
|
|
|
|
.SetSummary(summary_sp);
|
2016-09-07 04:57:50 +08:00
|
|
|
|
<rdar://problem/14393032>
DumpValueObject() 2.0
This checkin restores pre-Xcode5 functionality to the "po" (expr -O) command:
- expr now has a new --description-verbosity (-v) argument, which takes either compact or full as a value (-v is the same as -vfull)
When the full mode is on, "po" will show the extended output with type name, persistent variable name and value, as in
(lldb) expr -O -v -- foo
(id) $0 = 0x000000010010baf0 {
1 = 2;
2 = 3;
}
When -v is omitted, or -vcompact is passed, the Xcode5-style output will be shown, as in
(lldb) expr -O -- foo
{
1 = 2;
2 = 3;
}
- for a non-ObjectiveC object, LLDB will still try to retrieve a summary and/or value to display
(lldb) po 5
5
-v also works in this mode
(lldb) expr -O -vfull -- 5
(int) $4 = 5
On top of that, this is a major refactoring of the ValueObject printing code. The functionality is now factored into a ValueObjectPrinter class for easier maintenance in the future
DumpValueObject() was turned into an instance method ValueObject::Dump() which simply calls through to the printer code, Dump_Impl has been removed
Test case to follow
llvm-svn: 191694
2013-10-01 03:11:51 +08:00
|
|
|
if (lang_descr_verbosity ==
|
|
|
|
eLanguageRuntimeDescriptionDisplayVerbosityCompact)
|
2013-03-27 02:04:53 +08:00
|
|
|
options.SetHideRootType(use_objc).SetHideName(use_objc).SetHideValue(
|
|
|
|
use_objc);
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2013-03-27 02:04:53 +08:00
|
|
|
if (be_raw)
|
2014-11-22 02:47:26 +08:00
|
|
|
options.SetRawDisplay();
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2014-09-06 10:20:19 +08:00
|
|
|
options.SetRunValidator(run_validator);
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-04-25 08:52:47 +08:00
|
|
|
options.SetElementCount(elem_count);
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2013-03-27 02:04:53 +08:00
|
|
|
return options;
|
|
|
|
}
|