29 lldbassert(type_system &&
"type_system needs to be not NULL");
36 return type_system->GetBuiltinTypeForEncodingAndBitSize(
87 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingSint, 16);
90 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingSint, 32);
93 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingSint, 64);
96 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingSint, 8);
99 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingUint, 128);
102 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingUint, 16);
105 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingUint, 32);
108 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingUint, 64);
111 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingUint, 8);
124 return type_system->GetBuiltinTypeForEncodingAndBitSize(
eEncodingUint, 8);
165 bool is_signed =
false;
199static std::optional<size_t>
202 std::optional<uint64_t> container_elem_size = llvm::expectedToOptional(
204 if (!container_elem_size)
207 auto container_size = *container_elem_size * num_elements;
209 std::optional<uint64_t> element_size = llvm::expectedToOptional(
211 if (!element_size || !*element_size)
214 if (container_size % *element_size)
217 return container_size / *element_size;
236 if (!num_children_or_err)
239 if (idx >= *num_children_or_err)
245 auto offset = idx * *size_or_err;
247 idx_name.
Printf(
"[%" PRIu64
"]", (uint64_t)idx);
262 uint64_t num_elements;
277 return llvm::createStringError(
"Type has no child named '%s'",
280 uint32_t idx = *optional_idx;
282 return llvm::createStringError(
"Type has no child named '%s'",
299 auto synthetic_children =
301 if (!synthetic_children)
304 synthetic_children->Update();
310 len = synthetic_children->CalculateNumChildrenIgnoringErrors();
312 for (; idx < len; idx++) {
313 auto child_sp = synthetic_children->GetChildAtIndex(idx);
316 child_sp = child_sp->GetQualifiedRepresentationIfAvailable(
319 const char *child_value = child_sp->GetValueAsCString();
320 if (child_value && *child_value) {
322 s.
Printf(
"%s", child_value);
325 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.
llvm::Expected< 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 * AsCString(const char *value_if_empty=nullptr) 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)
SyntheticChildrenFrontEnd(ValueObject &backend)
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address=LLDB_INVALID_ADDRESS)
lldb::ValueObjectSP GetSP()
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 with file/line, symbol + offset,...
@ eFormatCharPrintable
Only printable characters, '.' if not printable.
@ eFormatComplexInteger
Integer complex type.
@ eFormatFloat128
Disambiguate between 128-bit long double (which uses eFormatFloat) and __float128 (which uses eFormat...
@ eEncodingUint
unsigned integer
@ eEncodingSint
signed integer