LLDB mainline
DumpValueObjectOptions.h
Go to the documentation of this file.
1//===-- DumpValueObjectOptions.h --------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_DATAFORMATTERS_DUMPVALUEOBJECTOPTIONS_H
10#define LLDB_DATAFORMATTERS_DUMPVALUEOBJECTOPTIONS_H
11
12#include <string>
13
14#include "lldb/lldb-private.h"
15#include "lldb/lldb-public.h"
16
17#include <functional>
18#include <string>
19
20namespace lldb_private {
21
23public:
24 struct PointerDepth {
25 enum class Mode { Always, Default, Never } m_mode;
26 uint32_t m_count;
27
29 if (m_count > 0)
30 return PointerDepth{m_mode, m_count - 1};
32 }
33
34 bool CanAllowExpansion() const;
35 };
36
38 size_t m_element_count = 0;
39 size_t m_base_element = 0;
40 size_t m_stride = 0;
41
43
44 PointerAsArraySettings(size_t elem_count, size_t base_elem = 0,
45 size_t stride = 1)
46 : m_element_count(elem_count), m_base_element(base_elem),
47 m_stride(stride) {}
48
49 operator bool() { return m_element_count > 0; }
50 };
51
52 typedef std::function<bool(ConstString, ConstString,
55
56 typedef std::function<bool(ConstString)> ChildPrintingDecider;
57
59 static DumpValueObjectOptions g_default_options;
60
61 return g_default_options;
62 }
63
65
67
69 SetMaximumPointerDepth(PointerDepth depth = {PointerDepth::Mode::Never, 0});
70
71 DumpValueObjectOptions &SetMaximumDepth(uint32_t depth, bool is_default);
72
74
76
77 DumpValueObjectOptions &SetShowTypes(bool show = false);
78
79 DumpValueObjectOptions &SetShowLocation(bool show = false);
80
82
83 DumpValueObjectOptions &SetShowSummary(bool show = true);
84
87
88 DumpValueObjectOptions &SetUseSyntheticValue(bool use_synthetic = true);
89
90 DumpValueObjectOptions &SetScopeChecked(bool check = true);
91
92 DumpValueObjectOptions &SetFlatOutput(bool flat = false);
93
95
96 DumpValueObjectOptions &SetIgnoreCap(bool ignore = false);
97
99
101
104
105 DumpValueObjectOptions &SetRootValueObjectName(const char *name = nullptr);
106
107 DumpValueObjectOptions &SetHideRootType(bool hide_root_type = false);
108
109 DumpValueObjectOptions &SetHideRootName(bool hide_root_name);
110
111 DumpValueObjectOptions &SetHideName(bool hide_name = false);
112
113 DumpValueObjectOptions &SetHideValue(bool hide_value = false);
114
116
119
120 DumpValueObjectOptions &SetRunValidator(bool run = true);
121
123
124 DumpValueObjectOptions &SetAllowOnelinerMode(bool oneliner = false);
125
127
128 DumpValueObjectOptions &SetElementCount(uint32_t element_count = 0);
129
131 SetPointerAsArray(const PointerAsArraySettings &ptr_array);
132
148 bool m_ignore_cap : 1;
149 bool m_show_types : 1;
151 bool m_use_objc : 1;
154 bool m_hide_name : 1;
155 bool m_hide_value : 1;
161};
162
163} // namespace lldb_private
164
165#endif // LLDB_DATAFORMATTERS_DUMPVALUEOBJECTOPTIONS_H
A uniqued constant string class.
Definition: ConstString.h:40
DumpValueObjectOptions & SetFlatOutput(bool flat=false)
DumpValueObjectOptions & SetVariableFormatDisplayLanguage(lldb::LanguageType lang=lldb::eLanguageTypeUnknown)
DumpValueObjectOptions & SetHideName(bool hide_name=false)
DumpValueObjectOptions & SetShowTypes(bool show=false)
DumpValueObjectOptions & SetMaximumDepth(uint32_t depth, bool is_default)
DumpValueObjectOptions & SetHideRootType(bool hide_root_type=false)
std::function< bool(ConstString)> ChildPrintingDecider
std::function< bool(ConstString, ConstString, const DumpValueObjectOptions &, Stream &)> DeclPrintingHelper
DumpValueObjectOptions & SetSummary(lldb::TypeSummaryImplSP summary=lldb::TypeSummaryImplSP())
DumpValueObjectOptions & SetUseTypeDisplayName(bool dis=false)
DumpValueObjectOptions & SetUseSyntheticValue(bool use_synthetic=true)
DumpValueObjectOptions & SetRevealEmptyAggregates(bool reveal=true)
DumpValueObjectOptions & SetOmitSummaryDepth(uint32_t depth=0)
DumpValueObjectOptions & SetPointerAsArray(const PointerAsArraySettings &ptr_array)
DumpValueObjectOptions & SetHideRootName(bool hide_root_name)
DumpValueObjectOptions & SetDeclPrintingHelper(DeclPrintingHelper helper)
DumpValueObjectOptions & SetChildPrintingDecider(ChildPrintingDecider decider)
DumpValueObjectOptions & SetRootValueObjectName(const char *name=nullptr)
DumpValueObjectOptions & SetUseDynamicType(lldb::DynamicValueType dyn=lldb::eNoDynamicValues)
DumpValueObjectOptions & SetFormat(lldb::Format format=lldb::eFormatDefault)
DumpValueObjectOptions & SetHidePointerValue(bool hide=false)
DumpValueObjectOptions & SetIgnoreCap(bool ignore=false)
DumpValueObjectOptions & SetScopeChecked(bool check=true)
DumpValueObjectOptions & SetAllowOnelinerMode(bool oneliner=false)
DumpValueObjectOptions & SetShowSummary(bool show=true)
DumpValueObjectOptions & SetUseObjectiveC(bool use=false)
DumpValueObjectOptions & SetShowLocation(bool show=false)
static const DumpValueObjectOptions DefaultOptions()
DumpValueObjectOptions & SetMaximumPointerDepth(PointerDepth depth={PointerDepth::Mode::Never, 0})
DumpValueObjectOptions & SetHideValue(bool hide_value=false)
DumpValueObjectOptions & SetRunValidator(bool run=true)
DumpValueObjectOptions & SetElementCount(uint32_t element_count=0)
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
#define UINT32_MAX
Definition: lldb-defines.h:19
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::TypeSummaryImpl > TypeSummaryImplSP
Definition: lldb-forward.h:471
Format
Display format definitions.
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
@ eNoDynamicValues
PointerAsArraySettings(size_t elem_count, size_t base_elem=0, size_t stride=1)
enum lldb_private::DumpValueObjectOptions::PointerDepth::Mode m_mode