9#ifndef LLDB_TARGET_PROCESSSTRUCTREADER_H
10#define LLDB_TARGET_PROCESSSTRUCTREADER_H
22#include <initializer_list>
51 for (
size_t idx = 0; idx < struct_type.
GetNumFields(); idx++) {
57 idx, name, &bit_offset, &bitfield_bit_size, &is_bitfield);
63 if (!size || *size > 8)
66 size_t byte_index =
static_cast<size_t>(bit_offset / 8);
68 FieldImpl{field_type, byte_index,
static_cast<size_t>(*size)};
73 lldb::WritableDataBufferSP buffer_sp(
new DataBufferHeap(*total_size, 0));
82 template <
typename RetType>
87 auto size = iter->second.size;
88 if (
sizeof(RetType) < size)
100 return iter->second.offset;
static llvm::raw_ostream & error(Stream &strm)
Generic representation of a type in a programming language.
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
CompilerType GetFieldAtIndex(size_t idx, std::string &name, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr) const
uint32_t GetNumFields() const
A uniqued constant string class.
A subclass of DataBuffer that stores a data buffer on the heap.
lldb::ByteOrder m_byte_order
ProcessStructReader(Process *process, lldb::addr_t base_addr, CompilerType struct_type)
std::map< ConstString, FieldImpl > m_fields
RetType GetField(ConstString name, RetType fail_value=RetType())
size_t GetOffsetOf(ConstString name, size_t fail_value=SIZE_MAX)
A plug-in interface definition class for debugging a process.
size_t ReadMemoryFromInferior(lldb::addr_t vm_addr, void *buf, size_t size, Status &error)
Read of memory from a process.
lldb::ByteOrder GetByteOrder() const
uint32_t GetAddressByteSize() const
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
ByteOrder
Byte ordering definitions.