12#include "llvm/Object/Error.h"
71 return llvm::make_error<llvm::object::GenericBinaryError>(
72 "Invalid arange header version");
75 return llvm::make_error<llvm::object::GenericBinaryError>(
76 "Invalid arange header address size");
79 return llvm::make_error<llvm::object::GenericBinaryError>(
80 "Invalid arange header length");
84 return llvm::make_error<llvm::object::GenericBinaryError>(
85 "Invalid arange header length");
88 return llvm::make_error<llvm::object::GenericBinaryError>(
89 "segmented arange entries are not supported");
98 while (first_tuple_offset < header_size)
99 first_tuple_offset += tuple_size;
101 *offset_ptr =
m_offset + first_tuple_offset;
105 static_assert(
sizeof(arangeDescriptor.
address) ==
106 sizeof(arangeDescriptor.
length),
107 "DWARFDebugArangeSet::Descriptor.address and "
108 "DWARFDebugArangeSet::Descriptor.length must have same size");
113 bool last_was_terminator =
false;
114 while (*offset_ptr < next_offset) {
127 if (arangeDescriptor.
address == 0 && arangeDescriptor.
length == 0) {
129 last_was_terminator =
true;
131 last_was_terminator =
false;
136 if (arangeDescriptor.
length > 0)
140 if (num_terminators > 1) {
143 "warning: DWARFDebugArangeSet at %#" PRIx64
" contains %u "
144 "terminator entries",
147 if (last_was_terminator)
148 return llvm::ErrorSuccess();
150 return llvm::make_error<llvm::object::GenericBinaryError>(
151 "arange descriptors not terminated by null entry");
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
DescriptorColl m_arange_descriptors
DescriptorColl::const_iterator DescriptorConstIter
dw_offset_t FindAddress(dw_addr_t address) const
dw_offset_t GetNextOffset() const
llvm::Error extract(const lldb_private::DWARFDataExtractor &data, lldb::offset_t *offset_ptr)
dw_offset_t m_next_offset
const dw_addr_t m_address
bool operator()(const DWARFDebugArangeSet::Descriptor &desc) const
DescriptorContainsAddress(dw_addr_t address)
#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.