29 lldbassert(type_system &&
"type_system needs to be not NULL");
36 return type_system->GetBuiltinTypeForEncodingAndBitSize(
85 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingSint, 16);
88 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingSint, 32);
91 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingSint, 64);
94 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingSint, 8);
97 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingUint, 128);
100 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingUint, 16);
103 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingUint, 32);
106 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingUint, 64);
109 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingUint, 8);
122 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingUint, 8);
163 bool is_signed =
false;
197static std::optional<size_t>
200 std::optional<uint64_t> container_elem_size =
202 if (!container_elem_size)
205 auto container_size = *container_elem_size * num_elements;
207 std::optional<uint64_t> element_size =
209 if (!element_size || !*element_size)
212 if (container_size % *element_size)
215 return container_size / *element_size;
219namespace formatters {
234 if (!num_children_or_err)
237 if (idx >= *num_children_or_err)
242 auto offset = idx * *size;
244 idx_name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
259 uint64_t num_elements;
293 auto synthetic_children =
295 if (!synthetic_children)
298 synthetic_children->Update();
304 len = synthetic_children->CalculateNumChildrenIgnoringErrors();
306 for (; idx < len; idx++) {
307 auto child_sp = synthetic_children->GetChildAtIndex(idx);
310 child_sp = child_sp->GetQualifiedRepresentationIfAvailable(
313 const char *child_value = child_sp->GetValueAsCString();
314 if (child_value && *child_value) {
316 s.
Printf(
"%s", child_value);
319 s.
Printf(
", %s", child_value);
static lldb::Format GetItemFormatForFormat(lldb::Format format, CompilerType element_type)
static CompilerType GetCompilerTypeForFormat(lldb::Format format, CompilerType element_type, TypeSystemSP type_system)
static std::optional< size_t > CalculateNumChildren(CompilerType container_elem_type, uint64_t num_elements, CompilerType element_type)
Calculates the number of elements stored in a container (with element type 'container_elem_type') as ...
lldb::TypeSystemSP GetSharedPointer() const
Generic representation of a type in a programming language.
TypeSystemSPWrapper GetTypeSystem() const
Accessors.
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
bool IsIntegerType(bool &is_signed) const
bool IsVectorType(CompilerType *element_type=nullptr, uint64_t *size=nullptr) const
A uniqued constant string class.
const char * GetCString() const
Get the string value as a C string.
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
llvm::StringRef GetString() const
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.
uint32_t CalculateNumChildrenIgnoringErrors(uint32_t max=UINT32_MAX)
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address=LLDB_INVALID_ADDRESS)
CompilerType GetCompilerType()
lldb::ValueObjectSP GetSP()
lldb::Format GetFormat() const
virtual lldb::ValueObjectSP GetSyntheticChildAtOffset(uint32_t offset, const CompilerType &type, bool can_create, ConstString name_const_str=ConstString())
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::TypeSystem > TypeSystemSP
ChildCacheState
Specifies if children need to be re-computed after a call to SyntheticChildrenFrontEnd::Update.
@ eRefetch
Children need to be recomputed dynamically.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Format
Display format definitions.
@ eFormatCString
NULL terminated C strings.
@ eFormatCharArray
Print characters with no single quotes, used for character arrays that can contain non printable char...
@ eFormatInstruction
Disassemble an opcode.
@ eFormatVoid
Do not print this.
@ eFormatComplex
Floating point complex type.
@ eFormatHexFloat
ISO C99 hex float string.
@ eFormatOSType
OS character codes encoded into an integer 'PICT' 'text' etc...
@ eFormatAddressInfo
Describe what an address points to (func + offset.
@ eFormatCharPrintable
Only printable characters, '.' if not printable.
@ eFormatComplexInteger
Integer complex type.
@ eEncodingUint
unsigned integer
@ eEncodingSint
signed integer