11#include "llvm/Support/ConvertUTF.h"
37static constexpr std::pair<const char *, Format>
40 case StringElementType::UTF8:
42 case StringElementType::UTF16:
44 case StringElementType::UTF32:
51template <StringElementType ElemType>
63 if (!StringPrinter::ReadStringAndDumpToStream<ElemType>(options))
64 stream.
Printf(
"Summary Unavailable");
69template <StringElementType ElemType>
85 stream.
Printf(
"%s ", value.c_str());
87 options.
SetData(std::move(data));
94 return StringPrinter::ReadBufferAndDumpToStream<ElemType>(options);
99 return CharStringSummaryProvider<StringElementType::UTF8>(valobj, stream);
104 return CharStringSummaryProvider<StringElementType::UTF16>(valobj, stream);
109 return CharStringSummaryProvider<StringElementType::UTF32>(valobj, stream);
122 if (!wchar_compiler_type)
126 std::optional<uint64_t> size = wchar_compiler_type.
GetBitSize(
nullptr);
129 const uint32_t wchar_size = *size;
137 switch (wchar_size) {
139 return StringPrinter::ReadStringAndDumpToStream<StringElementType::UTF8>(
142 return StringPrinter::ReadStringAndDumpToStream<StringElementType::UTF16>(
145 return StringPrinter::ReadStringAndDumpToStream<StringElementType::UTF32>(
148 stream.
Printf(
"size for wchar_t is not valid");
156 return CharSummaryProvider<StringElementType::UTF8>(valobj, stream);
161 return CharSummaryProvider<StringElementType::UTF16>(valobj, stream);
166 return CharSummaryProvider<StringElementType::UTF32>(valobj, stream);
182 if (!wchar_compiler_type)
186 std::optional<uint64_t> size = wchar_compiler_type.
GetBitSize(
nullptr);
189 const uint32_t wchar_size = *size;
192 options.
SetData(std::move(data));
199 switch (wchar_size) {
201 return StringPrinter::ReadBufferAndDumpToStream<StringElementType::UTF8>(
204 return StringPrinter::ReadBufferAndDumpToStream<StringElementType::UTF16>(
207 return StringPrinter::ReadBufferAndDumpToStream<StringElementType::UTF32>(
210 stream.
Printf(
"size for wchar_t is not valid");
static llvm::raw_ostream & error(Stream &strm)
static constexpr std::pair< const char *, Format > getElementTraits(StringElementType ElemType)
static bool CharSummaryProvider(ValueObject &valobj, Stream &stream)
static bool CharStringSummaryProvider(ValueObject &valobj, Stream &stream)
A section + offset based address class.
bool IsValid() const
Check if the object state is valid.
Generic representation of a type in a programming language.
CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type) const
Create related types using the current type's AST.
std::optional< uint64_t > GetBitSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bits.
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
virtual uint64_t GetData(DataExtractor &data, Status &error)
CompilerType GetCompilerType()
lldb::TargetSP GetTargetSP() const
virtual const char * GetValueAsCString()
A class that represents a running process on the host machine.