1 //===-- LibCxx.h ---------------------------------------------------*- C++
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_LibCxx_h_
11 #define liblldb_LibCxx_h_
13 #include "lldb/Core/ValueObject.h"
14 #include "lldb/DataFormatters/TypeSummary.h"
15 #include "lldb/DataFormatters/TypeSynthetic.h"
16 #include "lldb/Utility/Stream.h"
18 namespace lldb_private {
19 namespace formatters {
21 bool LibcxxStringSummaryProviderASCII(
22 ValueObject &valobj, Stream &stream,
23 const TypeSummaryOptions &summary_options); // libc++ std::string
25 bool LibcxxStringSummaryProviderUTF16(
26 ValueObject &valobj, Stream &stream,
27 const TypeSummaryOptions &summary_options); // libc++ std::u16string
29 bool LibcxxStringSummaryProviderUTF32(
30 ValueObject &valobj, Stream &stream,
31 const TypeSummaryOptions &summary_options); // libc++ std::u32string
33 bool LibcxxWStringSummaryProvider(
34 ValueObject &valobj, Stream &stream,
35 const TypeSummaryOptions &options); // libc++ std::wstring
37 bool LibcxxOptionalSummaryProvider(
38 ValueObject &valobj, Stream &stream,
39 const TypeSummaryOptions &options); // libc++ std::optional<>
41 bool LibcxxSmartPointerSummaryProvider(
42 ValueObject &valobj, Stream &stream,
43 const TypeSummaryOptions
44 &options); // libc++ std::shared_ptr<> and std::weak_ptr<>
46 bool LibcxxFunctionSummaryProvider(
47 ValueObject &valobj, Stream &stream,
48 const TypeSummaryOptions &options); // libc++ std::function<>
50 SyntheticChildrenFrontEnd *
51 LibcxxVectorBoolSyntheticFrontEndCreator(CXXSyntheticChildren *,
54 bool LibcxxContainerSummaryProvider(ValueObject &valobj, Stream &stream,
55 const TypeSummaryOptions &options);
57 class LibCxxMapIteratorSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
59 LibCxxMapIteratorSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);
61 size_t CalculateNumChildren() override;
63 lldb::ValueObjectSP GetChildAtIndex(size_t idx) override;
65 bool Update() override;
67 bool MightHaveChildren() override;
69 size_t GetIndexOfChildWithName(ConstString name) override;
71 ~LibCxxMapIteratorSyntheticFrontEnd() override;
74 ValueObject *m_pair_ptr;
75 lldb::ValueObjectSP m_pair_sp;
78 SyntheticChildrenFrontEnd *
79 LibCxxMapIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *,
82 SyntheticChildrenFrontEnd *
83 LibCxxVectorIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *,
86 class LibcxxSharedPtrSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
88 LibcxxSharedPtrSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);
90 size_t CalculateNumChildren() override;
92 lldb::ValueObjectSP GetChildAtIndex(size_t idx) override;
94 bool Update() override;
96 bool MightHaveChildren() override;
98 size_t GetIndexOfChildWithName(ConstString name) override;
100 ~LibcxxSharedPtrSyntheticFrontEnd() override;
103 ValueObject *m_cntrl;
104 lldb::ValueObjectSP m_count_sp;
105 lldb::ValueObjectSP m_weak_count_sp;
107 lldb::ByteOrder m_byte_order;
110 SyntheticChildrenFrontEnd *
111 LibcxxBitsetSyntheticFrontEndCreator(CXXSyntheticChildren *,
112 lldb::ValueObjectSP);
114 SyntheticChildrenFrontEnd *
115 LibcxxSharedPtrSyntheticFrontEndCreator(CXXSyntheticChildren *,
116 lldb::ValueObjectSP);
118 SyntheticChildrenFrontEnd *
119 LibcxxStdVectorSyntheticFrontEndCreator(CXXSyntheticChildren *,
120 lldb::ValueObjectSP);
122 SyntheticChildrenFrontEnd *
123 LibcxxStdListSyntheticFrontEndCreator(CXXSyntheticChildren *,
124 lldb::ValueObjectSP);
126 SyntheticChildrenFrontEnd *
127 LibcxxStdForwardListSyntheticFrontEndCreator(CXXSyntheticChildren *,
128 lldb::ValueObjectSP);
130 SyntheticChildrenFrontEnd *
131 LibcxxStdMapSyntheticFrontEndCreator(CXXSyntheticChildren *,
132 lldb::ValueObjectSP);
134 SyntheticChildrenFrontEnd *
135 LibcxxStdUnorderedMapSyntheticFrontEndCreator(CXXSyntheticChildren *,
136 lldb::ValueObjectSP);
138 SyntheticChildrenFrontEnd *
139 LibcxxInitializerListSyntheticFrontEndCreator(CXXSyntheticChildren *,
140 lldb::ValueObjectSP);
142 SyntheticChildrenFrontEnd *LibcxxQueueFrontEndCreator(CXXSyntheticChildren *,
143 lldb::ValueObjectSP);
145 SyntheticChildrenFrontEnd *LibcxxTupleFrontEndCreator(CXXSyntheticChildren *,
146 lldb::ValueObjectSP);
148 SyntheticChildrenFrontEnd *
149 LibcxxOptionalFrontEndCreator(CXXSyntheticChildren *,
150 lldb::ValueObjectSP valobj_sp);
152 SyntheticChildrenFrontEnd *
153 LibcxxVariantFrontEndCreator(CXXSyntheticChildren *,
154 lldb::ValueObjectSP valobj_sp);
156 } // namespace formatters
157 } // namespace lldb_private
159 #endif // liblldb_LibCxx_h_