File indexing completed on 2026-05-10 08:42:46
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_DATAFORMATTERS_DUMPVALUEOBJECTOPTIONS_H
0010 #define LLDB_DATAFORMATTERS_DUMPVALUEOBJECTOPTIONS_H
0011
0012 #include <string>
0013
0014 #include "lldb/lldb-private.h"
0015 #include "lldb/lldb-public.h"
0016
0017 #include <functional>
0018 #include <string>
0019
0020 namespace lldb_private {
0021
0022 class DumpValueObjectOptions {
0023 public:
0024 struct PointerDepth {
0025 uint32_t m_count = 0;
0026
0027 PointerDepth Decremented() const {
0028 if (m_count > 0)
0029 return {m_count - 1};
0030 return *this;
0031 }
0032
0033 bool CanAllowExpansion() const;
0034 };
0035
0036 struct PointerAsArraySettings {
0037 size_t m_element_count = 0;
0038 size_t m_base_element = 0;
0039 size_t m_stride = 0;
0040
0041 PointerAsArraySettings() = default;
0042
0043 PointerAsArraySettings(size_t elem_count, size_t base_elem = 0,
0044 size_t stride = 1)
0045 : m_element_count(elem_count), m_base_element(base_elem),
0046 m_stride(stride) {}
0047
0048 operator bool() { return m_element_count > 0; }
0049 };
0050
0051 typedef std::function<bool(ConstString, ConstString,
0052 const DumpValueObjectOptions &, Stream &)>
0053 DeclPrintingHelper;
0054
0055 typedef std::function<bool(ConstString)> ChildPrintingDecider;
0056
0057 static const DumpValueObjectOptions DefaultOptions() {
0058 static DumpValueObjectOptions g_default_options;
0059
0060 return g_default_options;
0061 }
0062
0063 DumpValueObjectOptions();
0064
0065 DumpValueObjectOptions(ValueObject &valobj);
0066
0067 DumpValueObjectOptions &SetMaximumPointerDepth(uint32_t depth);
0068
0069 DumpValueObjectOptions &SetMaximumDepth(uint32_t depth, bool is_default);
0070
0071 DumpValueObjectOptions &SetDeclPrintingHelper(DeclPrintingHelper helper);
0072
0073 DumpValueObjectOptions &SetChildPrintingDecider(ChildPrintingDecider decider);
0074
0075 DumpValueObjectOptions &SetShowTypes(bool show = false);
0076
0077 DumpValueObjectOptions &SetShowLocation(bool show = false);
0078
0079 DumpValueObjectOptions &SetUseObjectiveC(bool use = false);
0080
0081 DumpValueObjectOptions &SetShowSummary(bool show = true);
0082
0083 DumpValueObjectOptions &
0084 SetUseDynamicType(lldb::DynamicValueType dyn = lldb::eNoDynamicValues);
0085
0086 DumpValueObjectOptions &SetUseSyntheticValue(bool use_synthetic = true);
0087
0088 DumpValueObjectOptions &SetScopeChecked(bool check = true);
0089
0090 DumpValueObjectOptions &SetFlatOutput(bool flat = false);
0091
0092 DumpValueObjectOptions &SetOmitSummaryDepth(uint32_t depth = 0);
0093
0094 DumpValueObjectOptions &SetIgnoreCap(bool ignore = false);
0095
0096 DumpValueObjectOptions &SetRawDisplay();
0097
0098 DumpValueObjectOptions &SetFormat(lldb::Format format = lldb::eFormatDefault);
0099
0100 DumpValueObjectOptions &
0101 SetSummary(lldb::TypeSummaryImplSP summary = lldb::TypeSummaryImplSP());
0102
0103 DumpValueObjectOptions &SetRootValueObjectName(const char *name = nullptr);
0104
0105 DumpValueObjectOptions &SetHideRootType(bool hide_root_type = false);
0106
0107 DumpValueObjectOptions &SetHideRootName(bool hide_root_name);
0108
0109 DumpValueObjectOptions &SetHideName(bool hide_name = false);
0110
0111 DumpValueObjectOptions &SetHideValue(bool hide_value = false);
0112
0113 DumpValueObjectOptions &SetHidePointerValue(bool hide = false);
0114
0115 DumpValueObjectOptions &SetVariableFormatDisplayLanguage(
0116 lldb::LanguageType lang = lldb::eLanguageTypeUnknown);
0117
0118 DumpValueObjectOptions &SetRunValidator(bool run = true);
0119
0120 DumpValueObjectOptions &SetUseTypeDisplayName(bool dis = false);
0121
0122 DumpValueObjectOptions &SetAllowOnelinerMode(bool oneliner = false);
0123
0124 DumpValueObjectOptions &SetRevealEmptyAggregates(bool reveal = true);
0125
0126 DumpValueObjectOptions &SetElementCount(uint32_t element_count = 0);
0127
0128 DumpValueObjectOptions &
0129 SetPointerAsArray(const PointerAsArraySettings &ptr_array);
0130
0131 uint32_t m_max_depth = UINT32_MAX;
0132 bool m_max_depth_is_default = true;
0133 lldb::DynamicValueType m_use_dynamic = lldb::eNoDynamicValues;
0134 uint32_t m_omit_summary_depth = 0;
0135 lldb::Format m_format = lldb::eFormatDefault;
0136 lldb::TypeSummaryImplSP m_summary_sp;
0137 std::string m_root_valobj_name;
0138 lldb::LanguageType m_varformat_language = lldb::eLanguageTypeUnknown;
0139 PointerDepth m_max_ptr_depth;
0140 DeclPrintingHelper m_decl_printing_helper;
0141 ChildPrintingDecider m_child_printing_decider;
0142 PointerAsArraySettings m_pointer_as_array;
0143 bool m_use_synthetic : 1;
0144 bool m_scope_already_checked : 1;
0145 bool m_flat_output : 1;
0146 bool m_ignore_cap : 1;
0147 bool m_show_types : 1;
0148 bool m_show_location : 1;
0149 bool m_use_objc : 1;
0150 bool m_hide_root_type : 1;
0151 bool m_hide_root_name : 1;
0152 bool m_hide_name : 1;
0153 bool m_hide_value : 1;
0154 bool m_run_validator : 1;
0155 bool m_use_type_display_name : 1;
0156 bool m_allow_oneliner_mode : 1;
0157 bool m_hide_pointer_value : 1;
0158 bool m_reveal_empty_aggregates : 1;
0159 };
0160
0161 }
0162
0163 #endif