9#ifndef LLDB_TARGET_PROCESSSTRUCTREADER_H
10#define LLDB_TARGET_PROCESSSTRUCTREADER_H
21#include "llvm/ADT/StringMap.h"
23#include <initializer_list>
52 for (
size_t idx = 0; idx < struct_type.
GetNumFields(); idx++) {
55 uint32_t bitfield_bit_size;
58 idx, name, &bit_offset, &bitfield_bit_size, &is_bitfield);
64 if (!size || *size > 8)
66 size_t byte_index =
static_cast<size_t>(bit_offset / 8);
68 static_cast<size_t>(*size)}});
82 template <
typename RetType>
83 RetType
GetField(llvm::StringRef name, RetType fail_value = RetType()) {
87 auto size = iter->second.size;
88 if (
sizeof(RetType) < size)
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 subclass of DataBuffer that stores a data buffer on the heap.
lldb::ByteOrder m_byte_order
RetType GetField(llvm::StringRef name, RetType fail_value=RetType())
ProcessStructReader(Process *process, lldb::addr_t base_addr, CompilerType struct_type)
llvm::StringMap< FieldImpl > m_fields
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.
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP