Path: blob/main/contrib/llvm-project/lldb/source/Plugins/Language/CPlusPlus/LibCxx.h
39644 views
//===-- LibCxx.h ---------------------------------------------------*- C++1//-*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//89#ifndef LLDB_SOURCE_PLUGINS_LANGUAGE_CPLUSPLUS_LIBCXX_H10#define LLDB_SOURCE_PLUGINS_LANGUAGE_CPLUSPLUS_LIBCXX_H1112#include "lldb/Core/ValueObject.h"13#include "lldb/DataFormatters/TypeSummary.h"14#include "lldb/DataFormatters/TypeSynthetic.h"15#include "lldb/Utility/Stream.h"1617namespace lldb_private {18namespace formatters {1920/// Find a child member of \c obj_sp, trying all alternative names in order.21lldb::ValueObjectSP22GetChildMemberWithName(ValueObject &obj,23llvm::ArrayRef<ConstString> alternative_names);2425lldb::ValueObjectSP GetFirstValueOfLibCXXCompressedPair(ValueObject &pair);26lldb::ValueObjectSP GetSecondValueOfLibCXXCompressedPair(ValueObject &pair);272829bool LibcxxStringSummaryProviderASCII(30ValueObject &valobj, Stream &stream,31const TypeSummaryOptions &summary_options); // libc++ std::string3233bool LibcxxStringSummaryProviderUTF16(34ValueObject &valobj, Stream &stream,35const TypeSummaryOptions &summary_options); // libc++ std::u16string3637bool LibcxxStringSummaryProviderUTF32(38ValueObject &valobj, Stream &stream,39const TypeSummaryOptions &summary_options); // libc++ std::u32string4041bool LibcxxWStringSummaryProvider(42ValueObject &valobj, Stream &stream,43const TypeSummaryOptions &options); // libc++ std::wstring4445bool LibcxxStringViewSummaryProviderASCII(46ValueObject &valueObj, Stream &stream,47const TypeSummaryOptions &summary_options); // libc++ std::string_view4849bool LibcxxStringViewSummaryProviderUTF16(50ValueObject &valobj, Stream &stream,51const TypeSummaryOptions &summary_options); // libc++ std::u16string_view5253bool LibcxxStringViewSummaryProviderUTF32(54ValueObject &valobj, Stream &stream,55const TypeSummaryOptions &summary_options); // libc++ std::u32string_view5657bool LibcxxWStringViewSummaryProvider(58ValueObject &valobj, Stream &stream,59const TypeSummaryOptions &options); // libc++ std::wstring_view6061bool LibcxxStdSliceArraySummaryProvider(62ValueObject &valobj, Stream &stream,63const TypeSummaryOptions &options); // libc++ std::slice_array6465bool LibcxxSmartPointerSummaryProvider(66ValueObject &valobj, Stream &stream,67const TypeSummaryOptions68&options); // libc++ std::shared_ptr<> and std::weak_ptr<>6970// libc++ std::unique_ptr<>71bool LibcxxUniquePointerSummaryProvider(ValueObject &valobj, Stream &stream,72const TypeSummaryOptions &options);7374bool LibcxxFunctionSummaryProvider(75ValueObject &valobj, Stream &stream,76const TypeSummaryOptions &options); // libc++ std::function<>7778SyntheticChildrenFrontEnd *79LibcxxVectorBoolSyntheticFrontEndCreator(CXXSyntheticChildren *,80lldb::ValueObjectSP);8182bool LibcxxContainerSummaryProvider(ValueObject &valobj, Stream &stream,83const TypeSummaryOptions &options);8485/// Formatter for libc++ std::span<>.86bool LibcxxSpanSummaryProvider(ValueObject &valobj, Stream &stream,87const TypeSummaryOptions &options);8889SyntheticChildrenFrontEnd *90LibCxxVectorIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *,91lldb::ValueObjectSP);9293class LibcxxSharedPtrSyntheticFrontEnd : public SyntheticChildrenFrontEnd {94public:95LibcxxSharedPtrSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);9697llvm::Expected<uint32_t> CalculateNumChildren() override;9899lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override;100101lldb::ChildCacheState Update() override;102103bool MightHaveChildren() override;104105size_t GetIndexOfChildWithName(ConstString name) override;106107~LibcxxSharedPtrSyntheticFrontEnd() override;108109private:110ValueObject *m_cntrl;111};112113class LibcxxUniquePtrSyntheticFrontEnd : public SyntheticChildrenFrontEnd {114public:115LibcxxUniquePtrSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);116117llvm::Expected<uint32_t> CalculateNumChildren() override;118119lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override;120121lldb::ChildCacheState Update() override;122123bool MightHaveChildren() override;124125size_t GetIndexOfChildWithName(ConstString name) override;126127~LibcxxUniquePtrSyntheticFrontEnd() override;128129private:130lldb::ValueObjectSP m_value_ptr_sp;131lldb::ValueObjectSP m_deleter_sp;132};133134SyntheticChildrenFrontEnd *135LibcxxBitsetSyntheticFrontEndCreator(CXXSyntheticChildren *,136lldb::ValueObjectSP);137138SyntheticChildrenFrontEnd *139LibcxxSharedPtrSyntheticFrontEndCreator(CXXSyntheticChildren *,140lldb::ValueObjectSP);141142SyntheticChildrenFrontEnd *143LibcxxUniquePtrSyntheticFrontEndCreator(CXXSyntheticChildren *,144lldb::ValueObjectSP);145146SyntheticChildrenFrontEnd *147LibcxxStdVectorSyntheticFrontEndCreator(CXXSyntheticChildren *,148lldb::ValueObjectSP);149150SyntheticChildrenFrontEnd *151LibcxxStdValarraySyntheticFrontEndCreator(CXXSyntheticChildren *,152lldb::ValueObjectSP);153154SyntheticChildrenFrontEnd *155LibcxxStdSliceArraySyntheticFrontEndCreator(CXXSyntheticChildren *,156lldb::ValueObjectSP);157158SyntheticChildrenFrontEnd *159LibcxxStdProxyArraySyntheticFrontEndCreator(CXXSyntheticChildren *,160lldb::ValueObjectSP);161162SyntheticChildrenFrontEnd *163LibcxxStdListSyntheticFrontEndCreator(CXXSyntheticChildren *,164lldb::ValueObjectSP);165166SyntheticChildrenFrontEnd *167LibcxxStdForwardListSyntheticFrontEndCreator(CXXSyntheticChildren *,168lldb::ValueObjectSP);169170SyntheticChildrenFrontEnd *171LibcxxStdMapSyntheticFrontEndCreator(CXXSyntheticChildren *,172lldb::ValueObjectSP);173174SyntheticChildrenFrontEnd *175LibCxxMapIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *,176lldb::ValueObjectSP);177178SyntheticChildrenFrontEnd *179LibcxxStdUnorderedMapSyntheticFrontEndCreator(CXXSyntheticChildren *,180lldb::ValueObjectSP);181182SyntheticChildrenFrontEnd *183LibCxxUnorderedMapIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *,184lldb::ValueObjectSP);185186SyntheticChildrenFrontEnd *187LibcxxInitializerListSyntheticFrontEndCreator(CXXSyntheticChildren *,188lldb::ValueObjectSP);189190SyntheticChildrenFrontEnd *LibcxxQueueFrontEndCreator(CXXSyntheticChildren *,191lldb::ValueObjectSP);192193SyntheticChildrenFrontEnd *LibcxxTupleFrontEndCreator(CXXSyntheticChildren *,194lldb::ValueObjectSP);195196SyntheticChildrenFrontEnd *197LibcxxOptionalSyntheticFrontEndCreator(CXXSyntheticChildren *,198lldb::ValueObjectSP valobj_sp);199200SyntheticChildrenFrontEnd *201LibcxxVariantFrontEndCreator(CXXSyntheticChildren *,202lldb::ValueObjectSP valobj_sp);203204SyntheticChildrenFrontEnd *205LibcxxStdSpanSyntheticFrontEndCreator(CXXSyntheticChildren *,206lldb::ValueObjectSP);207208SyntheticChildrenFrontEnd *209LibcxxStdRangesRefViewSyntheticFrontEndCreator(CXXSyntheticChildren *,210lldb::ValueObjectSP);211212bool LibcxxChronoSysSecondsSummaryProvider(213ValueObject &valobj, Stream &stream,214const TypeSummaryOptions &options); // libc++ std::chrono::sys_seconds215216bool LibcxxChronoSysDaysSummaryProvider(217ValueObject &valobj, Stream &stream,218const TypeSummaryOptions &options); // libc++ std::chrono::sys_days219220bool LibcxxChronoLocalSecondsSummaryProvider(221ValueObject &valobj, Stream &stream,222const TypeSummaryOptions &options); // libc++ std::chrono::local_seconds223224bool LibcxxChronoLocalDaysSummaryProvider(225ValueObject &valobj, Stream &stream,226const TypeSummaryOptions &options); // libc++ std::chrono::local_days227228bool LibcxxChronoMonthSummaryProvider(229ValueObject &valobj, Stream &stream,230const TypeSummaryOptions &options); // libc++ std::chrono::month231232bool LibcxxChronoWeekdaySummaryProvider(233ValueObject &valobj, Stream &stream,234const TypeSummaryOptions &options); // libc++ std::chrono::weekday235236bool LibcxxChronoYearMonthDaySummaryProvider(237ValueObject &valobj, Stream &stream,238const TypeSummaryOptions &options); // libc++ std::chrono::year_month_day239240} // namespace formatters241} // namespace lldb_private242243#endif // LLDB_SOURCE_PLUGINS_LANGUAGE_CPLUSPLUS_LIBCXX_H244245246