LLDB mainline
LibCxx.h
Go to the documentation of this file.
1//===-- LibCxx.h ---------------------------------------------------*- C++
2//-*-===//
3//
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
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLDB_SOURCE_PLUGINS_LANGUAGE_CPLUSPLUS_LIBCXX_H
11#define LLDB_SOURCE_PLUGINS_LANGUAGE_CPLUSPLUS_LIBCXX_H
12
15#include "lldb/Utility/Stream.h"
17
18namespace lldb_private {
19namespace formatters {
20
21/// Find a child member of \c obj_sp, trying all alternative names in order.
23GetChildMemberWithName(ValueObject &obj,
24 llvm::ArrayRef<ConstString> alternative_names);
25
28bool isOldCompressedPairLayout(ValueObject &pair_obj);
29bool isStdTemplate(ConstString type_name, llvm::StringRef type);
30
32 ValueObject &valobj, Stream &stream,
33 const TypeSummaryOptions &summary_options); // libc++ std::string
34
36 ValueObject &valobj, Stream &stream,
37 const TypeSummaryOptions &summary_options); // libc++ std::u16string
38
40 ValueObject &valobj, Stream &stream,
41 const TypeSummaryOptions &summary_options); // libc++ std::u32string
42
44 ValueObject &valobj, Stream &stream,
45 const TypeSummaryOptions &options); // libc++ std::wstring
46
48 ValueObject &valueObj, Stream &stream,
49 const TypeSummaryOptions &summary_options); // libc++ std::string_view
50
52 ValueObject &valobj, Stream &stream,
53 const TypeSummaryOptions &summary_options); // libc++ std::u16string_view
54
56 ValueObject &valobj, Stream &stream,
57 const TypeSummaryOptions &summary_options); // libc++ std::u32string_view
58
60 ValueObject &valobj, Stream &stream,
61 const TypeSummaryOptions &options); // libc++ std::wstring_view
62
64 ValueObject &valobj, Stream &stream,
65 const TypeSummaryOptions &options); // libc++ std::slice_array
66
68 ValueObject &valobj, Stream &stream,
69 const TypeSummaryOptions
70 &options); // libc++ std::shared_ptr<> and std::weak_ptr<>
71
72// libc++ std::unique_ptr<>
73bool LibcxxUniquePointerSummaryProvider(ValueObject &valobj, Stream &stream,
74 const TypeSummaryOptions &options);
75
77 ValueObject &valobj, Stream &stream,
78 const TypeSummaryOptions &options); // libc++ std::function<>
79
80SyntheticChildrenFrontEnd *
83
85 const TypeSummaryOptions &options);
86
87/// Formatter for libc++ std::span<>.
89 const TypeSummaryOptions &options);
90
94
96public:
98
99 llvm::Expected<uint32_t> CalculateNumChildren() override;
100
101 lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override;
102
103 lldb::ChildCacheState Update() override;
104
105 bool MightHaveChildren() override;
106
107 size_t GetIndexOfChildWithName(ConstString name) override;
108
110
111private:
113};
114
116public:
118
119 llvm::Expected<uint32_t> CalculateNumChildren() override;
120
121 lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override;
122
123 lldb::ChildCacheState Update() override;
124
125 bool MightHaveChildren() override;
126
127 size_t GetIndexOfChildWithName(ConstString name) override;
128
130
131private:
134};
135
139
143
147
151
155
159
163
167
171
175
179
183
187
191
194
197
200 lldb::ValueObjectSP valobj_sp);
201
204 lldb::ValueObjectSP valobj_sp);
205
209
213
215 ValueObject &valobj, Stream &stream,
216 const TypeSummaryOptions &options); // libc++ std::chrono::sys_seconds
217
219 ValueObject &valobj, Stream &stream,
220 const TypeSummaryOptions &options); // libc++ std::chrono::sys_days
221
223 ValueObject &valobj, Stream &stream,
224 const TypeSummaryOptions &options); // libc++ std::chrono::local_seconds
225
227 ValueObject &valobj, Stream &stream,
228 const TypeSummaryOptions &options); // libc++ std::chrono::local_days
229
231 ValueObject &valobj, Stream &stream,
232 const TypeSummaryOptions &options); // libc++ std::chrono::month
233
235 ValueObject &valobj, Stream &stream,
236 const TypeSummaryOptions &options); // libc++ std::chrono::weekday
237
239 ValueObject &valobj, Stream &stream,
240 const TypeSummaryOptions &options); // libc++ std::chrono::year_month_day
241
242} // namespace formatters
243} // namespace lldb_private
244
245#endif // LLDB_SOURCE_PLUGINS_LANGUAGE_CPLUSPLUS_LIBCXX_H
A uniqued constant string class.
Definition: ConstString.h:40
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override
Definition: LibCxx.cpp:264
llvm::Expected< uint32_t > CalculateNumChildren() override
Definition: LibCxx.cpp:259
lldb::ChildCacheState Update() override
This function is assumed to always succeed and if it fails, the front-end should know to deal with it...
Definition: LibCxx.cpp:294
size_t GetIndexOfChildWithName(ConstString name) override
Definition: LibCxx.cpp:318
llvm::Expected< uint32_t > CalculateNumChildren() override
Definition: LibCxx.cpp:354
lldb::ChildCacheState Update() override
This function is assumed to always succeed and if it fails, the front-end should know to deal with it...
Definition: LibCxx.cpp:384
lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override
Definition: LibCxx.cpp:361
size_t GetIndexOfChildWithName(ConstString name) override
Definition: LibCxx.cpp:421
SyntheticChildrenFrontEnd * LibCxxUnorderedMapIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
SyntheticChildrenFrontEnd * LibcxxStdSpanSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxSpan.cpp:142
lldb::ValueObjectSP GetChildMemberWithName(ValueObject &obj, llvm::ArrayRef< ConstString > alternative_names)
Find a child member of obj_sp, trying all alternative names in order.
Definition: LibCxx.cpp:64
SyntheticChildrenFrontEnd * LibcxxStdSliceArraySyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
bool LibcxxChronoSysSecondsSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:838
bool LibcxxChronoMonthSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:904
SyntheticChildrenFrontEnd * LibcxxUniquePtrSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:347
bool LibcxxUniquePointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:196
bool LibcxxSmartPointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:154
bool LibcxxStringViewSummaryProviderASCII(ValueObject &valueObj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:755
bool LibcxxStringViewSummaryProviderUTF16(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:762
SyntheticChildrenFrontEnd * LibCxxVectorIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:244
bool LibcxxStringViewSummaryProviderUTF32(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:769
SyntheticChildrenFrontEnd * LibcxxQueueFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxQueue.cpp:60
SyntheticChildrenFrontEnd * LibcxxBitsetSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
bool LibcxxChronoYearMonthDaySummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:946
bool LibcxxWStringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:608
SyntheticChildrenFrontEnd * LibcxxTupleFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxTuple.cpp:90
bool LibcxxStringSummaryProviderASCII(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:695
bool LibcxxChronoLocalSecondsSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:844
SyntheticChildrenFrontEnd * LibcxxStdRangesRefViewSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
bool LibcxxSpanSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Formatter for libc++ std::span<>.
bool LibcxxWStringViewSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:776
bool LibcxxChronoWeekdaySummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:925
bool isStdTemplate(ConstString type_name, llvm::StringRef type)
Definition: LibCxx.cpp:55
SyntheticChildrenFrontEnd * LibcxxInitializerListSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
lldb::ValueObjectSP GetFirstValueOfLibCXXCompressedPair(ValueObject &pair)
Definition: LibCxx.cpp:76
SyntheticChildrenFrontEnd * LibcxxOptionalSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP valobj_sp)
bool LibcxxStringSummaryProviderUTF16(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:702
bool LibcxxStdSliceArraySummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
bool LibcxxFunctionSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:106
bool LibcxxStringSummaryProviderUTF32(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:709
SyntheticChildrenFrontEnd * LibcxxStdListSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxList.cpp:431
bool LibcxxChronoLocalDaysSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:898
lldb::ValueObjectSP GetSecondValueOfLibCXXCompressedPair(ValueObject &pair)
Definition: LibCxx.cpp:90
SyntheticChildrenFrontEnd * LibcxxStdValarraySyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
SyntheticChildrenFrontEnd * LibcxxStdMapSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxMap.cpp:411
SyntheticChildrenFrontEnd * LibcxxVariantFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP valobj_sp)
SyntheticChildrenFrontEnd * LibcxxStdProxyArraySyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
SyntheticChildrenFrontEnd * LibcxxStdVectorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
SyntheticChildrenFrontEnd * LibcxxStdUnorderedMapSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
bool isOldCompressedPairLayout(ValueObject &pair_obj)
Definition: LibCxx.cpp:50
SyntheticChildrenFrontEnd * LibcxxVectorBoolSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
bool LibcxxContainerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:431
SyntheticChildrenFrontEnd * LibcxxStdForwardListSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxList.cpp:437
SyntheticChildrenFrontEnd * LibcxxSharedPtrSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:330
SyntheticChildrenFrontEnd * LibCxxMapIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxMap.cpp:514
bool LibcxxChronoSysDaysSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:892
A class that represents a running process on the host machine.
ChildCacheState
Specifies if children need to be re-computed after a call to SyntheticChildrenFrontEnd::Update.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Definition: lldb-forward.h:484