LLVM: lib/DebugInfo/DWARF/DWARFDebugRangeList.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

14#include

15#include

16

17using namespace llvm;

18

20 uint8_t AddressSize) const {

23}

24

26 Offset = -1ULL;

27 AddressSize = 0;

28 Entries.clear();

29}

30

34 if (data.isValidOffset(*offset_ptr))

36 "invalid range list offset 0x%" PRIx64, *offset_ptr);

37

38 AddressSize = data.getAddressSize();

41 "range list at offset 0x%" PRIx64, *offset_ptr))

42 return SizeErr;

43 Offset = *offset_ptr;

44 while (true) {

47

48 uint64_t prev_offset = *offset_ptr;

49 Entry.StartAddress = data.getRelocatedAddress(offset_ptr);

50 Entry.EndAddress =

51 data.getRelocatedAddress(offset_ptr, &Entry.SectionIndex);

52

53

54 if (*offset_ptr != prev_offset + 2 * AddressSize) {

57 "invalid range list entry at offset 0x%" PRIx64,

58 prev_offset);

59 }

60 if (Entry.isEndOfListEntry())

61 break;

62 Entries.push_back(Entry);

63 }

65}

66

68 const char *AddrFmt;

69 switch (AddressSize) {

70 case 2:

71 AddrFmt = "%08" PRIx64 " %04" PRIx64 " %04" PRIx64 "\n";

72 break;

73 case 4:

74 AddrFmt = "%08" PRIx64 " %08" PRIx64 " %08" PRIx64 "\n";

75 break;

76 case 8:

77 AddrFmt = "%08" PRIx64 " %016" PRIx64 " %016" PRIx64 "\n";

78 break;

79 default:

81 }

83 OS << format(AddrFmt, Offset, RLE.StartAddress, RLE.EndAddress);

84 OS << format("%08" PRIx64 " \n", Offset);

85}

86

88 std::optionalobject::SectionedAddress BaseAddr) const {

90

91

94 if (RLE.isBaseAddressSelectionEntry(AddressSize)) {

95 BaseAddr = {RLE.EndAddress, RLE.SectionIndex};

96 continue;

97 }

98

100 E.LowPC = RLE.StartAddress;

102 continue;

103 E.HighPC = RLE.EndAddress;

104 E.SectionIndex = RLE.SectionIndex;

105

106

107

108 if (BaseAddr) {

109 if (BaseAddr->Address == Tombstone)

110 continue;

111 E.LowPC += BaseAddr->Address;

112 E.HighPC += BaseAddr->Address;

113 if (E.SectionIndex == -1ULL)

114 E.SectionIndex = BaseAddr->SectionIndex;

115 }

116 Res.push_back(E);

117 }

118 return Res;

119}

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

LocallyHashedType DenseMapInfo< LocallyHashedType >::Tombstone

static Error checkAddressSizeSupported(unsigned AddressSize, std::error_code EC, char const *Fmt, const Ts &...Vals)

static bool isAddressSizeSupported(unsigned AddressSize)

LLVM_ABI Error extract(const DWARFDataExtractor &data, uint64_t *offset_ptr)

Definition DWARFDebugRangeList.cpp:31

LLVM_ABI void clear()

Definition DWARFDebugRangeList.cpp:25

LLVM_ABI DWARFAddressRangesVector getAbsoluteRanges(std::optional< object::SectionedAddress > BaseAddr) const

getAbsoluteRanges - Returns absolute address ranges defined by this range list.

Definition DWARFDebugRangeList.cpp:87

LLVM_ABI void dump(raw_ostream &OS) const

Definition DWARFDebugRangeList.cpp:67

Lightweight error class with error context and mandatory checking.

static ErrorSuccess success()

Create a success value.

This class implements an extremely fast bulk output stream that can only output to a stream.

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

uint64_t computeTombstoneAddress(uint8_t AddressByteSize)

This is an optimization pass for GlobalISel generic memory operations.

Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)

Create formatted StringError object.

format_object< Ts... > format(const char *Fmt, const Ts &... Vals)

These are helper functions used to produce formatted output.

std::vector< DWARFAddressRange > DWARFAddressRangesVector

DWARFAddressRangesVector - represents a set of absolute address ranges.

uint64_t SectionIndex

A section index this range belongs to.

LLVM_ABI bool isBaseAddressSelectionEntry(uint8_t AddressSize) const

A base address selection entry consists of:

Definition DWARFDebugRangeList.cpp:19

uint64_t StartAddress

A beginning address offset.