Lines Matching +full:address +full:- +full:data

1 //===-- DWARFDebugArangeSet.cpp -------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
32 llvm::Error DWARFDebugArangeSet::extract(const DWARFDataExtractor &data, in extract() argument
34 assert(data.ValidOffset(*offset_ptr)); in extract()
39 // 7.20 Address Range Table in extract()
41 // Each set of entries in the table of address ranges contained in the in extract()
42 // .debug_aranges section begins with a header consisting of: a 4-byte in extract()
44 // unit, not including the length field itself; a 2-byte version identifier in extract()
45 // containing the value 2 for DWARF Version 2; a 4-byte offset into in extract()
46 // the.debug_infosection; a 1-byte unsigned integer containing the size in in extract()
47 // bytes of an address (or the offset portion of an address for segmented in extract()
48 // addressing) on the target system; and a 1-byte unsigned integer in extract()
51 // consists of an address and a length, each in the size appropriate for an in extract()
52 // address on the target architecture. in extract()
53 m_header.length = data.GetDWARFInitialLength(offset_ptr); in extract()
60 m_header.version = data.GetU16(offset_ptr); in extract()
61 m_header.cu_offset = data.GetDWARFOffset(offset_ptr); in extract()
62 m_header.addr_size = data.GetU8(offset_ptr); in extract()
63 m_header.seg_size = data.GetU8(offset_ptr); in extract()
66 // 1 - the version looks good in extract()
67 // 2 - the address byte size looks plausible in extract()
68 // 3 - the length seems to make sense in extract()
69 // 4 - size looks plausible in extract()
70 // 5 - the arange tuples do not contain a segment field in extract()
77 "Invalid arange header address size"); in extract()
83 if (!data.ValidOffset(m_offset + sizeof(m_header.length) + m_header.length - in extract()
94 // size of an address). The header is padded, if necessary, to the in extract()
96 const uint32_t header_size = *offset_ptr - m_offset; in extract()
106 static_assert(sizeof(arangeDescriptor.address) == in extract()
108 "DWARFDebugArangeSet::Descriptor.address and " in extract()
116 arangeDescriptor.address = data.GetMaxU64(offset_ptr, m_header.addr_size); in extract()
117 arangeDescriptor.length = data.GetMaxU64(offset_ptr, m_header.addr_size); in extract()
119 // Each set of tuples is terminated by a 0 for the address and 0 for in extract()
125 // need to make sure we parse all valid address pairs so we don't omit them in extract()
128 if (arangeDescriptor.address == 0 && arangeDescriptor.length == 0) { in extract()
133 // Only add .debug_aranges address entries that have a non zero size. in extract()
136 // entries at address zero and remove those as well. in extract()
157 DescriptorContainsAddress(dw_addr_t address) : m_address(address) {} in DescriptorContainsAddress() argument
159 return (m_address >= desc.address) && in operator ()()
160 (m_address < (desc.address + desc.length)); in operator ()()
167 dw_offset_t DWARFDebugArangeSet::FindAddress(dw_addr_t address) const { in FindAddress()
171 DescriptorContainsAddress(address)); // Predicate in FindAddress()