File indexing completed on 2026-05-10 08:43:41
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLVM_DEBUGINFO_DWARF_DWARFDEBUGARANGESET_H
0010 #define LLVM_DEBUGINFO_DWARF_DWARFDEBUGARANGESET_H
0011
0012 #include "llvm/ADT/iterator_range.h"
0013 #include "llvm/BinaryFormat/Dwarf.h"
0014 #include "llvm/Support/Error.h"
0015 #include <cstdint>
0016 #include <vector>
0017
0018 namespace llvm {
0019
0020 class raw_ostream;
0021 class DWARFDataExtractor;
0022
0023 class DWARFDebugArangeSet {
0024 public:
0025 struct Header {
0026
0027
0028 uint64_t Length;
0029
0030 dwarf::DwarfFormat Format;
0031
0032
0033 uint64_t CuOffset;
0034
0035 uint16_t Version;
0036
0037
0038 uint8_t AddrSize;
0039
0040
0041 uint8_t SegSize;
0042 };
0043
0044 struct Descriptor {
0045 uint64_t Address;
0046 uint64_t Length;
0047
0048 uint64_t getEndAddress() const { return Address + Length; }
0049 void dump(raw_ostream &OS, uint32_t AddressSize) const;
0050 };
0051
0052 private:
0053 using DescriptorColl = std::vector<Descriptor>;
0054 using desc_iterator_range = iterator_range<DescriptorColl::const_iterator>;
0055
0056 uint64_t Offset;
0057 Header HeaderData;
0058 DescriptorColl ArangeDescriptors;
0059
0060 public:
0061 DWARFDebugArangeSet() { clear(); }
0062
0063 void clear();
0064 Error extract(DWARFDataExtractor data, uint64_t *offset_ptr,
0065 function_ref<void(Error)> WarningHandler = nullptr);
0066 void dump(raw_ostream &OS) const;
0067
0068 uint64_t getCompileUnitDIEOffset() const { return HeaderData.CuOffset; }
0069
0070 const Header &getHeader() const { return HeaderData; }
0071
0072 desc_iterator_range descriptors() const {
0073 return desc_iterator_range(ArangeDescriptors.begin(),
0074 ArangeDescriptors.end());
0075 }
0076 };
0077
0078 }
0079
0080 #endif