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>
73 stream.
Printf(
"Summary Unavailable");
78template <StringElementType ElemType>
94 stream.
Printf(
"%s ", value.c_str());
96 options.
SetData(std::move(data));
131 const uint32_t wchar_size = *size;
140 uint64_t arr_size = 0;
141 if (ty.
IsArrayType(
nullptr, &arr_size) && arr_size > 0) {
148 switch (wchar_size) {
159 stream.
Printf(
"size for wchar_t is not valid");
193 const uint32_t wchar_size = *size;
196 options.
SetData(std::move(data));
203 switch (wchar_size) {
214 stream.
Printf(
"size for wchar_t is not valid");
220std::optional<uint64_t>
222 return llvm::expectedToOptional(
228template <StringPr
inter::StringElementType element_type>
245 const auto max_size =
246 location_sp->GetTargetSP()->GetMaximumSizeOfStringSummary();
247 if (size > max_size) {
249 options.SetIsTruncated(
true);
255 const size_t bytes_read = location_sp->GetPointeeData(extractor, 0, size);
256 if (bytes_read < size)
259 options.SetData(std::move(extractor));
261 options.SetStream(&stream);
262 if (prefix_token.empty())
263 options.SetPrefixToken(
nullptr);
265 options.SetPrefixToken(prefix_token);
266 options.SetQuote(
'"');
267 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