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
16#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
28
29
31 ValueObject &valobj, Stream &stream,
32 const TypeSummaryOptions &summary_options); // libc++ std::string
33
35 ValueObject &valobj, Stream &stream,
36 const TypeSummaryOptions &summary_options); // libc++ std::u16string
37
39 ValueObject &valobj, Stream &stream,
40 const TypeSummaryOptions &summary_options); // libc++ std::u32string
41
43 ValueObject &valobj, Stream &stream,
44 const TypeSummaryOptions &options); // libc++ std::wstring
45
47 ValueObject &valueObj, Stream &stream,
48 const TypeSummaryOptions &summary_options); // libc++ std::string_view
49
51 ValueObject &valobj, Stream &stream,
52 const TypeSummaryOptions &summary_options); // libc++ std::u16string_view
53
55 ValueObject &valobj, Stream &stream,
56 const TypeSummaryOptions &summary_options); // libc++ std::u32string_view
57
59 ValueObject &valobj, Stream &stream,
60 const TypeSummaryOptions &options); // libc++ std::wstring_view
61
63 ValueObject &valobj, Stream &stream,
64 const TypeSummaryOptions &options); // libc++ std::slice_array
65
67 ValueObject &valobj, Stream &stream,
68 const TypeSummaryOptions
69 &options); // libc++ std::shared_ptr<> and std::weak_ptr<>
70
71// libc++ std::unique_ptr<>
72bool LibcxxUniquePointerSummaryProvider(ValueObject &valobj, Stream &stream,
73 const TypeSummaryOptions &options);
74
76 ValueObject &valobj, Stream &stream,
77 const TypeSummaryOptions &options); // libc++ std::function<>
78
79SyntheticChildrenFrontEnd *
82
84 const TypeSummaryOptions &options);
85
86/// Formatter for libc++ std::span<>.
88 const TypeSummaryOptions &options);
89
93
95public:
97
98 llvm::Expected<uint32_t> CalculateNumChildren() override;
99
100 lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override;
101
102 lldb::ChildCacheState Update() override;
103
104 bool MightHaveChildren() override;
105
106 size_t GetIndexOfChildWithName(ConstString name) override;
107
109
110private:
112};
113
115public:
117
118 llvm::Expected<uint32_t> CalculateNumChildren() override;
119
120 lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override;
121
122 lldb::ChildCacheState Update() override;
123
124 bool MightHaveChildren() override;
125
126 size_t GetIndexOfChildWithName(ConstString name) override;
127
129
130private:
133};
134
138
142
146
150
154
158
162
166
170
174
178
182
186
190
193
196
199 lldb::ValueObjectSP valobj_sp);
200
203 lldb::ValueObjectSP valobj_sp);
204
208
212
214 ValueObject &valobj, Stream &stream,
215 const TypeSummaryOptions &options); // libc++ std::chrono::sys_seconds
216
218 ValueObject &valobj, Stream &stream,
219 const TypeSummaryOptions &options); // libc++ std::chrono::sys_days
220
222 ValueObject &valobj, Stream &stream,
223 const TypeSummaryOptions &options); // libc++ std::chrono::local_seconds
224
226 ValueObject &valobj, Stream &stream,
227 const TypeSummaryOptions &options); // libc++ std::chrono::local_days
228
230 ValueObject &valobj, Stream &stream,
231 const TypeSummaryOptions &options); // libc++ std::chrono::month
232
234 ValueObject &valobj, Stream &stream,
235 const TypeSummaryOptions &options); // libc++ std::chrono::weekday
236
238 ValueObject &valobj, Stream &stream,
239 const TypeSummaryOptions &options); // libc++ std::chrono::year_month_day
240
241} // namespace formatters
242} // namespace lldb_private
243
244#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:235
llvm::Expected< uint32_t > CalculateNumChildren() override
Definition: LibCxx.cpp:230
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:265
size_t GetIndexOfChildWithName(ConstString name) override
Definition: LibCxx.cpp:289
llvm::Expected< uint32_t > CalculateNumChildren() override
Definition: LibCxx.cpp:325
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:355
lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override
Definition: LibCxx.cpp:332
size_t GetIndexOfChildWithName(ConstString name) override
Definition: LibCxx.cpp:383
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:37
SyntheticChildrenFrontEnd * LibcxxStdSliceArraySyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
bool LibcxxChronoSysSecondsSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:797
bool LibcxxChronoMonthSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:863
SyntheticChildrenFrontEnd * LibcxxUniquePtrSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:318
bool LibcxxUniquePointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:169
bool LibcxxSmartPointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:127
bool LibcxxStringViewSummaryProviderASCII(ValueObject &valueObj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:714
bool LibcxxStringViewSummaryProviderUTF16(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:721
SyntheticChildrenFrontEnd * LibCxxVectorIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:215
bool LibcxxStringViewSummaryProviderUTF32(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:728
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:905
bool LibcxxWStringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:567
SyntheticChildrenFrontEnd * LibcxxTupleFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxTuple.cpp:90
bool LibcxxStringSummaryProviderASCII(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:654
bool LibcxxChronoLocalSecondsSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:803
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:735
bool LibcxxChronoWeekdaySummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:884
SyntheticChildrenFrontEnd * LibcxxInitializerListSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
lldb::ValueObjectSP GetFirstValueOfLibCXXCompressedPair(ValueObject &pair)
Definition: LibCxx.cpp:49
SyntheticChildrenFrontEnd * LibcxxOptionalSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP valobj_sp)
bool LibcxxStringSummaryProviderUTF16(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:661
bool LibcxxStdSliceArraySummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
bool LibcxxFunctionSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:79
bool LibcxxStringSummaryProviderUTF32(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:668
SyntheticChildrenFrontEnd * LibcxxStdListSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxList.cpp:417
bool LibcxxChronoLocalDaysSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:857
lldb::ValueObjectSP GetSecondValueOfLibCXXCompressedPair(ValueObject &pair)
Definition: LibCxx.cpp:63
SyntheticChildrenFrontEnd * LibcxxStdValarraySyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
SyntheticChildrenFrontEnd * LibcxxStdMapSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxMap.cpp:392
SyntheticChildrenFrontEnd * LibcxxVariantFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP valobj_sp)
SyntheticChildrenFrontEnd * LibcxxStdProxyArraySyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
SyntheticChildrenFrontEnd * LibcxxStdVectorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
SyntheticChildrenFrontEnd * LibcxxStdUnorderedMapSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
SyntheticChildrenFrontEnd * LibcxxVectorBoolSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
bool LibcxxContainerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:393
SyntheticChildrenFrontEnd * LibcxxStdForwardListSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxList.cpp:423
SyntheticChildrenFrontEnd * LibcxxSharedPtrSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:301
SyntheticChildrenFrontEnd * LibCxxMapIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxMap.cpp:495
bool LibcxxChronoSysDaysSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:851
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:479