[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
|
|
|
//===-- DumpValueObjectOptions.cpp ----------------------------------------===//
|
2015-10-20 06:04:25 +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
|
2015-10-20 06:04:25 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "lldb/DataFormatters/DumpValueObjectOptions.h"
|
|
|
|
|
|
|
|
#include "lldb/Core/ValueObject.h"
|
|
|
|
|
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
|
|
|
DumpValueObjectOptions::DumpValueObjectOptions()
|
2015-11-14 05:37:47 +08:00
|
|
|
: m_summary_sp(), m_root_valobj_name(),
|
|
|
|
m_max_ptr_depth(PointerDepth{PointerDepth::Mode::Default, 0}),
|
2016-11-05 02:15:39 +08:00
|
|
|
m_decl_printing_helper(), m_pointer_as_array(), m_use_synthetic(true),
|
2015-11-14 05:37:47 +08:00
|
|
|
m_scope_already_checked(false), m_flat_output(false), m_ignore_cap(false),
|
|
|
|
m_show_types(false), m_show_location(false), m_use_objc(false),
|
|
|
|
m_hide_root_type(false), m_hide_name(false), m_hide_value(false),
|
|
|
|
m_run_validator(false), m_use_type_display_name(true),
|
|
|
|
m_allow_oneliner_mode(true), m_hide_pointer_value(false),
|
|
|
|
m_reveal_empty_aggregates(true) {}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2015-10-20 06:04:25 +08:00
|
|
|
DumpValueObjectOptions::DumpValueObjectOptions(ValueObject &valobj)
|
2015-11-14 05:37:47 +08:00
|
|
|
: DumpValueObjectOptions() {
|
2015-10-20 06:04:25 +08:00
|
|
|
m_use_dynamic = valobj.GetDynamicValueType();
|
|
|
|
m_use_synthetic = valobj.IsSynthetic();
|
|
|
|
m_varformat_language = valobj.GetPreferredDisplayLanguage();
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2015-10-20 06:04:25 +08:00
|
|
|
DumpValueObjectOptions &
|
|
|
|
DumpValueObjectOptions::SetMaximumPointerDepth(PointerDepth depth) {
|
|
|
|
m_max_ptr_depth = depth;
|
|
|
|
return *this;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2015-10-20 06:04:25 +08:00
|
|
|
DumpValueObjectOptions &
|
|
|
|
DumpValueObjectOptions::SetMaximumDepth(uint32_t depth) {
|
|
|
|
m_max_depth = depth;
|
|
|
|
return *this;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2015-10-20 06:04:25 +08:00
|
|
|
DumpValueObjectOptions &
|
|
|
|
DumpValueObjectOptions::SetDeclPrintingHelper(DeclPrintingHelper helper) {
|
|
|
|
m_decl_printing_helper = helper;
|
|
|
|
return *this;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2015-10-20 06:04:25 +08:00
|
|
|
DumpValueObjectOptions &DumpValueObjectOptions::SetShowTypes(bool show) {
|
|
|
|
m_show_types = show;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
DumpValueObjectOptions &DumpValueObjectOptions::SetShowLocation(bool show) {
|
|
|
|
m_show_location = show;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
DumpValueObjectOptions &DumpValueObjectOptions::SetUseObjectiveC(bool use) {
|
|
|
|
m_use_objc = use;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
DumpValueObjectOptions &DumpValueObjectOptions::SetShowSummary(bool show) {
|
2018-12-15 08:15:33 +08:00
|
|
|
if (!show)
|
2015-10-20 06:04:25 +08:00
|
|
|
SetOmitSummaryDepth(UINT32_MAX);
|
2016-09-07 04:57:50 +08:00
|
|
|
else
|
2015-10-20 06:04:25 +08:00
|
|
|
SetOmitSummaryDepth(0);
|
|
|
|
return *this;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2015-10-20 06:04:25 +08:00
|
|
|
DumpValueObjectOptions &
|
|
|
|
DumpValueObjectOptions::SetUseDynamicType(lldb::DynamicValueType dyn) {
|
|
|
|
m_use_dynamic = dyn;
|
|
|
|
return *this;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2015-10-20 06:04:25 +08:00
|
|
|
DumpValueObjectOptions &
|
|
|
|
DumpValueObjectOptions::SetUseSyntheticValue(bool use_synthetic) {
|
|
|
|
m_use_synthetic = use_synthetic;
|
|
|
|
return *this;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2015-10-20 06:04:25 +08:00
|
|
|
DumpValueObjectOptions &DumpValueObjectOptions::SetScopeChecked(bool check) {
|
|
|
|
m_scope_already_checked = check;
|
|
|
|
return *this;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2015-10-20 06:04:25 +08:00
|
|
|
DumpValueObjectOptions &DumpValueObjectOptions::SetFlatOutput(bool flat) {
|
|
|
|
m_flat_output = flat;
|
|
|
|
return *this;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2015-10-20 06:04:25 +08:00
|
|
|
DumpValueObjectOptions &
|
|
|
|
DumpValueObjectOptions::SetOmitSummaryDepth(uint32_t depth) {
|
|
|
|
m_omit_summary_depth = depth;
|
|
|
|
return *this;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2015-10-20 06:04:25 +08:00
|
|
|
DumpValueObjectOptions &DumpValueObjectOptions::SetIgnoreCap(bool ignore) {
|
|
|
|
m_ignore_cap = ignore;
|
|
|
|
return *this;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2015-10-20 06:04:25 +08:00
|
|
|
DumpValueObjectOptions &DumpValueObjectOptions::SetRawDisplay() {
|
|
|
|
SetUseSyntheticValue(false);
|
|
|
|
SetOmitSummaryDepth(UINT32_MAX);
|
|
|
|
SetIgnoreCap(true);
|
|
|
|
SetHideName(false);
|
|
|
|
SetHideValue(false);
|
|
|
|
SetUseTypeDisplayName(false);
|
|
|
|
SetAllowOnelinerMode(false);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
DumpValueObjectOptions &DumpValueObjectOptions::SetFormat(lldb::Format format) {
|
|
|
|
m_format = format;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
DumpValueObjectOptions &
|
|
|
|
DumpValueObjectOptions::SetSummary(lldb::TypeSummaryImplSP summary) {
|
|
|
|
m_summary_sp = summary;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
DumpValueObjectOptions &
|
|
|
|
DumpValueObjectOptions::SetRootValueObjectName(const char *name) {
|
|
|
|
if (name)
|
|
|
|
m_root_valobj_name.assign(name);
|
|
|
|
else
|
|
|
|
m_root_valobj_name.clear();
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
DumpValueObjectOptions &
|
|
|
|
DumpValueObjectOptions::SetHideRootType(bool hide_root_type) {
|
|
|
|
m_hide_root_type = hide_root_type;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
DumpValueObjectOptions &DumpValueObjectOptions::SetHideName(bool hide_name) {
|
|
|
|
m_hide_name = hide_name;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
DumpValueObjectOptions &DumpValueObjectOptions::SetHideValue(bool hide_value) {
|
|
|
|
m_hide_value = hide_value;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
DumpValueObjectOptions &DumpValueObjectOptions::SetHidePointerValue(bool hide) {
|
|
|
|
m_hide_pointer_value = hide;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
DumpValueObjectOptions &
|
|
|
|
DumpValueObjectOptions::SetVariableFormatDisplayLanguage(
|
|
|
|
lldb::LanguageType lang) {
|
|
|
|
m_varformat_language = lang;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
DumpValueObjectOptions &DumpValueObjectOptions::SetRunValidator(bool run) {
|
|
|
|
m_run_validator = run;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
DumpValueObjectOptions &
|
|
|
|
DumpValueObjectOptions::SetUseTypeDisplayName(bool dis) {
|
|
|
|
m_use_type_display_name = dis;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
DumpValueObjectOptions &
|
|
|
|
DumpValueObjectOptions::SetAllowOnelinerMode(bool oneliner) {
|
|
|
|
m_allow_oneliner_mode = oneliner;
|
|
|
|
return *this;
|
|
|
|
}
|
2015-11-11 03:07:58 +08:00
|
|
|
|
|
|
|
DumpValueObjectOptions &
|
|
|
|
DumpValueObjectOptions::SetRevealEmptyAggregates(bool reveal) {
|
|
|
|
m_reveal_empty_aggregates = reveal;
|
|
|
|
return *this;
|
|
|
|
}
|
2016-04-25 08:52:47 +08:00
|
|
|
|
|
|
|
DumpValueObjectOptions &
|
|
|
|
DumpValueObjectOptions::SetElementCount(uint32_t element_count) {
|
2016-11-05 02:15:39 +08:00
|
|
|
m_pointer_as_array = PointerAsArraySettings(element_count);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
DumpValueObjectOptions &DumpValueObjectOptions::SetPointerAsArray(
|
|
|
|
const PointerAsArraySettings &ptr_array) {
|
|
|
|
m_pointer_as_array = ptr_array;
|
2016-04-25 08:52:47 +08:00
|
|
|
return *this;
|
|
|
|
}
|