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_DumpValueObjectOptions_h_
10 #define lldb_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 
20 namespace lldb_private {
21 
23 public:
24  struct PointerDepth {
25  enum class Mode { Always, Default, Never } m_mode;
27 
29  if (m_count > 0)
30  return PointerDepth{m_mode, m_count - 1};
31  return PointerDepth{m_mode, m_count};
32  }
33 
34  bool CanAllowExpansion() const;
35  };
36 
40  size_t m_stride;
41 
43  : m_element_count(0), m_base_element(0), m_stride() {}
44 
45  PointerAsArraySettings(size_t elem_count, size_t base_elem = 0,
46  size_t stride = 1)
47  : m_element_count(elem_count), m_base_element(base_elem),
48  m_stride(stride) {}
49 
50  operator bool() { return m_element_count > 0; }
51  };
52 
53  typedef std::function<bool(ConstString, ConstString,
54  const DumpValueObjectOptions &, Stream &)>
56 
58  static DumpValueObjectOptions g_default_options;
59 
60  return g_default_options;
61  }
62 
64 
65  DumpValueObjectOptions(const DumpValueObjectOptions &rhs) = default;
66 
68 
71 
73 
75 
76  DumpValueObjectOptions &SetShowTypes(bool show = false);
77 
78  DumpValueObjectOptions &SetShowLocation(bool show = false);
79 
80  DumpValueObjectOptions &SetUseObjectiveC(bool use = false);
81 
82  DumpValueObjectOptions &SetShowSummary(bool show = true);
83 
86 
87  DumpValueObjectOptions &SetUseSyntheticValue(bool use_synthetic = true);
88 
89  DumpValueObjectOptions &SetScopeChecked(bool check = true);
90 
91  DumpValueObjectOptions &SetFlatOutput(bool flat = false);
92 
94 
95  DumpValueObjectOptions &SetIgnoreCap(bool ignore = false);
96 
98 
100 
102  SetSummary(lldb::TypeSummaryImplSP summary = lldb::TypeSummaryImplSP());
103 
104  DumpValueObjectOptions &SetRootValueObjectName(const char *name = nullptr);
105 
106  DumpValueObjectOptions &SetHideRootType(bool hide_root_type = false);
107 
108  DumpValueObjectOptions &SetHideName(bool hide_name = false);
109 
110  DumpValueObjectOptions &SetHideValue(bool hide_value = false);
111 
112  DumpValueObjectOptions &SetHidePointerValue(bool hide = false);
113 
116 
117  DumpValueObjectOptions &SetRunValidator(bool run = true);
118 
120 
121  DumpValueObjectOptions &SetAllowOnelinerMode(bool oneliner = false);
122 
124 
125  DumpValueObjectOptions &SetElementCount(uint32_t element_count = 0);
126 
128  SetPointerAsArray(const PointerAsArraySettings &ptr_array);
129 
130 public:
135  lldb::TypeSummaryImplSP m_summary_sp;
136  std::string m_root_valobj_name;
141  bool m_use_synthetic : 1;
143  bool m_flat_output : 1;
144  bool m_ignore_cap : 1;
145  bool m_show_types : 1;
146  bool m_show_location : 1;
147  bool m_use_objc : 1;
149  bool m_hide_name : 1;
150  bool m_hide_value : 1;
151  bool m_run_validator : 1;
156 };
157 
158 } // namespace lldb_private
159 
160 #endif // lldb_DumpValueObjectOptions_h_
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
DumpValueObjectOptions & SetMaximumDepth(uint32_t depth=0)
enum lldb_private::DumpValueObjectOptions::PointerDepth::Mode m_mode
static const DumpValueObjectOptions DefaultOptions()
DumpValueObjectOptions & SetHideValue(bool hide_value=false)
DumpValueObjectOptions & SetSummary(lldb::TypeSummaryImplSP summary=lldb::TypeSummaryImplSP())
DumpValueObjectOptions & SetHideName(bool hide_name=false)
DumpValueObjectOptions & SetShowLocation(bool show=false)
DumpValueObjectOptions & SetElementCount(uint32_t element_count=0)
DumpValueObjectOptions & SetPointerAsArray(const PointerAsArraySettings &ptr_array)
DumpValueObjectOptions & SetScopeChecked(bool check=true)
DumpValueObjectOptions & SetUseObjectiveC(bool use=false)
DumpValueObjectOptions & SetShowSummary(bool show=true)
DumpValueObjectOptions & SetRootValueObjectName(const char *name=nullptr)
DumpValueObjectOptions & SetRunValidator(bool run=true)
#define UINT32_MAX
Definition: lldb-defines.h:31
DumpValueObjectOptions & SetUseDynamicType(lldb::DynamicValueType dyn=lldb::eNoDynamicValues)
LanguageType
Programming language type.
DumpValueObjectOptions & SetShowTypes(bool show=false)
DumpValueObjectOptions & SetIgnoreCap(bool ignore=false)
DumpValueObjectOptions & SetDeclPrintingHelper(DeclPrintingHelper helper)
DumpValueObjectOptions & SetHideRootType(bool hide_root_type=false)
DumpValueObjectOptions & SetMaximumPointerDepth(PointerDepth depth={PointerDepth::Mode::Never, 0})
A uniqued constant string class.
Definition: ConstString.h:38
Unknown or invalid language value.
DumpValueObjectOptions & SetAllowOnelinerMode(bool oneliner=false)
DumpValueObjectOptions & SetUseSyntheticValue(bool use_synthetic=true)
PointerAsArraySettings(size_t elem_count, size_t base_elem=0, size_t stride=1)
std::function< bool(ConstString, ConstString, const DumpValueObjectOptions &, Stream &)> DeclPrintingHelper
DumpValueObjectOptions & SetHidePointerValue(bool hide=false)
DumpValueObjectOptions & SetFlatOutput(bool flat=false)
DumpValueObjectOptions & SetFormat(lldb::Format format=lldb::eFormatDefault)
DumpValueObjectOptions & SetRevealEmptyAggregates(bool reveal=true)
DumpValueObjectOptions & SetOmitSummaryDepth(uint32_t depth=0)
DumpValueObjectOptions & SetUseTypeDisplayName(bool dis=false)
DumpValueObjectOptions & SetVariableFormatDisplayLanguage(lldb::LanguageType lang=lldb::eLanguageTypeUnknown)