11#include "llvm/Support/ConvertUTF.h"
36static constexpr std::pair<const char *, Format>
39 case StringElementType::UTF8:
41 case StringElementType::UTF16:
43 case StringElementType::UTF32:
50template <StringElementType ElemType>
72 stream.
Printf(
"Summary Unavailable");
77template <StringElementType ElemType>
93 stream.
Printf(
"%s ", value.c_str());
95 options.
SetData(std::move(data));
130 const uint32_t wchar_size = *size;
139 uint64_t arr_size = 0;
140 if (ty.
IsArrayType(
nullptr, &arr_size) && arr_size > 0) {
147 switch (wchar_size) {
158 stream.
Printf(
"size for wchar_t is not valid");
192 const uint32_t wchar_size = *size;
195 options.
SetData(std::move(data));
202 switch (wchar_size) {
213 stream.
Printf(
"size for wchar_t is not valid");
219std::optional<uint64_t>
221 return llvm::expectedToOptional(
227template <StringPr
inter::StringElementType element_type>
244 const auto max_size =
245 location_sp->GetTargetSP()->GetMaximumSizeOfStringSummary();
246 if (size > max_size) {
248 options.SetIsTruncated(
true);
254 const size_t bytes_read = location_sp->GetPointeeData(extractor, 0, size);
255 if (bytes_read < size)
258 options.SetData(std::move(extractor));
260 options.SetStream(&stream);
261 if (prefix_token.empty())
262 options.SetPrefixToken(
nullptr);
264 options.SetPrefixToken(prefix_token);
265 options.SetQuote(
'"');
266 options.SetSourceSize(size);
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)
StringPrinter::StringElementType StringElementType
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.
bool IsArrayType(CompilerType *element_type=nullptr, uint64_t *size=nullptr, bool *is_incomplete=nullptr) const
llvm::Expected< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
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.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
lldb::TypeSummaryCapping GetCapping() const
virtual uint64_t GetData(DataExtractor &data, Status &error)
lldb::TargetSP GetTargetSP() const
CompilerType GetCompilerType()
virtual const char * GetValueAsCString()
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP