12#include "llvm/Object/Error.h"
72 return llvm::make_error<llvm::object::GenericBinaryError>(
73 "Invalid arange header version");
76 return llvm::make_error<llvm::object::GenericBinaryError>(
77 "Invalid arange header address size");
80 return llvm::make_error<llvm::object::GenericBinaryError>(
81 "Invalid arange header length");
85 return llvm::make_error<llvm::object::GenericBinaryError>(
86 "Invalid arange header length");
89 return llvm::make_error<llvm::object::GenericBinaryError>(
90 "segmented arange entries are not supported");
96 const uint32_t header_size = *offset_ptr -
m_offset;
98 uint32_t first_tuple_offset = 0;
99 while (first_tuple_offset < header_size)
100 first_tuple_offset += tuple_size;
102 *offset_ptr =
m_offset + first_tuple_offset;
106 static_assert(
sizeof(arangeDescriptor.
address) ==
107 sizeof(arangeDescriptor.
length),
108 "DWARFDebugArangeSet::Descriptor.address and "
109 "DWARFDebugArangeSet::Descriptor.length must have same size");
113 uint32_t num_terminators = 0;
114 bool last_was_terminator =
false;
115 while (*offset_ptr < next_offset) {
128 if (arangeDescriptor.
address == 0 && arangeDescriptor.
length == 0) {
130 last_was_terminator =
true;
132 last_was_terminator =
false;
137 if (arangeDescriptor.
length > 0)
141 if (num_terminators > 1) {
144 "warning: DWARFDebugArangeSet at %#" PRIx64
" contains %u "
145 "terminator entries",
148 if (last_was_terminator)
149 return llvm::ErrorSuccess();
151 return llvm::make_error<llvm::object::GenericBinaryError>(
152 "arange descriptors not terminated by null entry");
159 return (m_address >= desc.
address) &&
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
const dw_addr_t m_address
bool operator()(const DWARFDebugArangeSet::Descriptor &desc) const
DescriptorContainsAddress(dw_addr_t address)
dw_offset_t GetNextOffset() const
dw_offset_t FindAddress(dw_addr_t address) const
dw_offset_t m_next_offset
DescriptorColl::const_iterator DescriptorConstIter
llvm::Error extract(const DWARFDataExtractor &data, lldb::offset_t *offset_ptr)
DescriptorColl m_arange_descriptors
#define DW_INVALID_OFFSET
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.