File indexing completed on 2026-05-10 08:43:41
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLVM_DEBUGINFO_DWARF_DWARFDEBUGADDR_H
0010 #define LLVM_DEBUGINFO_DWARF_DWARFDEBUGADDR_H
0011
0012 #include "llvm/BinaryFormat/Dwarf.h"
0013 #include "llvm/DebugInfo/DIContext.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
0024
0025
0026 class DWARFDebugAddrTable {
0027 dwarf::DwarfFormat Format;
0028 uint64_t Offset;
0029
0030
0031 uint64_t Length = 0;
0032
0033 uint16_t Version;
0034
0035
0036
0037 uint8_t AddrSize;
0038
0039
0040 uint8_t SegSize;
0041 std::vector<uint64_t> Addrs;
0042
0043
0044 void invalidateLength() { Length = 0; }
0045
0046 Error extractAddresses(const DWARFDataExtractor &Data, uint64_t *OffsetPtr,
0047 uint64_t EndOffset);
0048
0049 public:
0050
0051
0052 Error extract(const DWARFDataExtractor &Data, uint64_t *OffsetPtr,
0053 uint16_t CUVersion, uint8_t CUAddrSize,
0054 std::function<void(Error)> WarnCallback);
0055
0056
0057 Error extractV5(const DWARFDataExtractor &Data, uint64_t *OffsetPtr,
0058 uint8_t CUAddrSize, std::function<void(Error)> WarnCallback);
0059
0060
0061
0062
0063 Error extractPreStandard(const DWARFDataExtractor &Data, uint64_t *OffsetPtr,
0064 uint16_t CUVersion, uint8_t CUAddrSize);
0065
0066 void dump(raw_ostream &OS, DIDumpOptions DumpOpts = {}) const;
0067
0068
0069 Expected<uint64_t> getAddrEntry(uint32_t Index) const;
0070
0071
0072
0073 std::optional<uint64_t> getFullLength() const;
0074
0075
0076 dwarf::DwarfFormat getFormat() const { return Format; }
0077
0078
0079 uint64_t getLength() const { return Length; }
0080
0081
0082 uint16_t getVersion() const { return Version; }
0083
0084
0085 uint8_t getAddressSize() const { return AddrSize; }
0086
0087
0088 uint8_t getSegmentSelectorSize() const { return SegSize; }
0089
0090
0091 ArrayRef<uint64_t> getAddressEntries() const { return Addrs; }
0092 };
0093
0094 }
0095
0096 #endif