1 //===-- LibCxx.h ---------------------------------------------------*- C++
4 // The LLVM Compiler Infrastructure
6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 #ifndef liblldb_LibCxx_h_
12 #define liblldb_LibCxx_h_
14 #include "lldb/Core/ValueObject.h"
15 #include "lldb/DataFormatters/TypeSummary.h"
16 #include "lldb/DataFormatters/TypeSynthetic.h"
17 #include "lldb/Utility/Stream.h"
19 namespace lldb_private {
20 namespace formatters {
22 bool LibcxxStringSummaryProviderASCII(
23 ValueObject &valobj, Stream &stream,
24 const TypeSummaryOptions &summary_options); // libc++ std::string
26 bool LibcxxStringSummaryProviderUTF16(
27 ValueObject &valobj, Stream &stream,
28 const TypeSummaryOptions &summary_options); // libc++ std::u16string
30 bool LibcxxStringSummaryProviderUTF32(
31 ValueObject &valobj, Stream &stream,
32 const TypeSummaryOptions &summary_options); // libc++ std::u32string
34 bool LibcxxWStringSummaryProvider(
35 ValueObject &valobj, Stream &stream,
36 const TypeSummaryOptions &options); // libc++ std::wstring
38 bool LibcxxOptionalSummaryProvider(
39 ValueObject &valobj, Stream &stream,
40 const TypeSummaryOptions &options); // libc++ std::optional<>
42 bool LibcxxSmartPointerSummaryProvider(
43 ValueObject &valobj, Stream &stream,
44 const TypeSummaryOptions
45 &options); // libc++ std::shared_ptr<> and std::weak_ptr<>
47 bool LibcxxFunctionSummaryProvider(
48 ValueObject &valobj, Stream &stream,
49 const TypeSummaryOptions &options); // libc++ std::function<>
51 SyntheticChildrenFrontEnd *
52 LibcxxVectorBoolSyntheticFrontEndCreator(CXXSyntheticChildren *,
55 bool LibcxxContainerSummaryProvider(ValueObject &valobj, Stream &stream,
56 const TypeSummaryOptions &options);
58 class LibCxxMapIteratorSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
60 LibCxxMapIteratorSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);
62 size_t CalculateNumChildren() override;
64 lldb::ValueObjectSP GetChildAtIndex(size_t idx) override;
66 bool Update() override;
68 bool MightHaveChildren() override;
70 size_t GetIndexOfChildWithName(const ConstString &name) override;
72 ~LibCxxMapIteratorSyntheticFrontEnd() override;
75 ValueObject *m_pair_ptr;
76 lldb::ValueObjectSP m_pair_sp;
79 SyntheticChildrenFrontEnd *
80 LibCxxMapIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *,
83 SyntheticChildrenFrontEnd *
84 LibCxxVectorIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *,
87 class LibcxxSharedPtrSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
89 LibcxxSharedPtrSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);
91 size_t CalculateNumChildren() override;
93 lldb::ValueObjectSP GetChildAtIndex(size_t idx) override;
95 bool Update() override;
97 bool MightHaveChildren() override;
99 size_t GetIndexOfChildWithName(const ConstString &name) override;
101 ~LibcxxSharedPtrSyntheticFrontEnd() override;
104 ValueObject *m_cntrl;
105 lldb::ValueObjectSP m_count_sp;
106 lldb::ValueObjectSP m_weak_count_sp;
108 lldb::ByteOrder m_byte_order;
111 SyntheticChildrenFrontEnd *
112 LibcxxBitsetSyntheticFrontEndCreator(CXXSyntheticChildren *,
113 lldb::ValueObjectSP);
115 SyntheticChildrenFrontEnd *
116 LibcxxSharedPtrSyntheticFrontEndCreator(CXXSyntheticChildren *,
117 lldb::ValueObjectSP);
119 SyntheticChildrenFrontEnd *
120 LibcxxStdVectorSyntheticFrontEndCreator(CXXSyntheticChildren *,
121 lldb::ValueObjectSP);
123 SyntheticChildrenFrontEnd *
124 LibcxxStdListSyntheticFrontEndCreator(CXXSyntheticChildren *,
125 lldb::ValueObjectSP);
127 SyntheticChildrenFrontEnd *
128 LibcxxStdForwardListSyntheticFrontEndCreator(CXXSyntheticChildren *,
129 lldb::ValueObjectSP);
131 SyntheticChildrenFrontEnd *
132 LibcxxStdMapSyntheticFrontEndCreator(CXXSyntheticChildren *,
133 lldb::ValueObjectSP);
135 SyntheticChildrenFrontEnd *
136 LibcxxStdUnorderedMapSyntheticFrontEndCreator(CXXSyntheticChildren *,
137 lldb::ValueObjectSP);
139 SyntheticChildrenFrontEnd *
140 LibcxxInitializerListSyntheticFrontEndCreator(CXXSyntheticChildren *,
141 lldb::ValueObjectSP);
143 SyntheticChildrenFrontEnd *LibcxxQueueFrontEndCreator(CXXSyntheticChildren *,
144 lldb::ValueObjectSP);
146 SyntheticChildrenFrontEnd *LibcxxTupleFrontEndCreator(CXXSyntheticChildren *,
147 lldb::ValueObjectSP);
149 SyntheticChildrenFrontEnd *
150 LibcxxOptionalFrontEndCreator(CXXSyntheticChildren *,
151 lldb::ValueObjectSP valobj_sp);
153 SyntheticChildrenFrontEnd *
154 LibcxxVariantFrontEndCreator(CXXSyntheticChildren *,
155 lldb::ValueObjectSP valobj_sp);
157 } // namespace formatters
158 } // namespace lldb_private
160 #endif // liblldb_LibCxx_h_