1 //===- DWARFDebugArangeSet.h ------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_DEBUGINFO_DWARFDEBUGARANGESET_H
10 #define LLVM_DEBUGINFO_DWARFDEBUGARANGESET_H
12 #include "llvm/ADT/iterator_range.h"
13 #include "llvm/Support/DataExtractor.h"
21 class DWARFDebugArangeSet
{
24 /// The total length of the entries for that set, not including the length
27 /// The offset from the beginning of the .debug_info section of the
28 /// compilation unit entry referenced by the table.
30 /// The DWARF version number.
32 /// The size in bytes of an address on the target architecture. For segmented
33 /// addressing, this is the size of the offset portion of the address.
35 /// The size in bytes of a segment descriptor on the target architecture.
36 /// If the target system uses a flat address space, this value is 0.
44 uint64_t getEndAddress() const { return Address
+ Length
; }
45 void dump(raw_ostream
&OS
, uint32_t AddressSize
) const;
49 using DescriptorColl
= std::vector
<Descriptor
>;
50 using desc_iterator_range
= iterator_range
<DescriptorColl::const_iterator
>;
54 DescriptorColl ArangeDescriptors
;
57 DWARFDebugArangeSet() { clear(); }
60 bool extract(DataExtractor data
, uint64_t *offset_ptr
);
61 void dump(raw_ostream
&OS
) const;
63 uint32_t getCompileUnitDIEOffset() const { return HeaderData
.CuOffset
; }
65 const Header
&getHeader() const { return HeaderData
; }
67 desc_iterator_range
descriptors() const {
68 return desc_iterator_range(ArangeDescriptors
.begin(),
69 ArangeDescriptors
.end());
73 } // end namespace llvm
75 #endif // LLVM_DEBUGINFO_DWARFDEBUGARANGESET_H