Skip to content

Commit 2142e20

Browse files
committed
[DWARF] Fix DWARFDebugAranges to support 64-bit CU offsets.
DWARFContext, the only user of this class, can already handle such offsets. Differential Revision: https://reviews.llvm.org/D71834
1 parent 4b1d471 commit 2142e20

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class DWARFContext;
2121
class DWARFDebugAranges {
2222
public:
2323
void generate(DWARFContext *CTX);
24-
uint32_t findAddress(uint64_t Address) const;
24+
uint64_t findAddress(uint64_t Address) const;
2525

2626
private:
2727
void clear();
@@ -33,7 +33,7 @@ class DWARFDebugAranges {
3333

3434
struct Range {
3535
explicit Range(uint64_t LowPC = -1ULL, uint64_t HighPC = -1ULL,
36-
uint32_t CUOffset = -1U)
36+
uint64_t CUOffset = -1ULL)
3737
: LowPC(LowPC), Length(HighPC - LowPC), CUOffset(CUOffset) {}
3838

3939
void setHighPC(uint64_t HighPC) {
@@ -54,8 +54,8 @@ class DWARFDebugAranges {
5454
}
5555

5656
uint64_t LowPC; /// Start of address range.
57-
uint32_t Length; /// End of address range (not including this address).
58-
uint32_t CUOffset; /// Offset of the compile unit or die.
57+
uint64_t Length; /// End of address range (not including this address).
58+
uint64_t CUOffset; /// Offset of the compile unit or die.
5959
};
6060

6161
struct RangeEndpoint {

llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ void DWARFDebugAranges::construct() {
113113
Endpoints.shrink_to_fit();
114114
}
115115

116-
uint32_t DWARFDebugAranges::findAddress(uint64_t Address) const {
116+
uint64_t DWARFDebugAranges::findAddress(uint64_t Address) const {
117117
RangeCollIterator It =
118118
partition_point(Aranges, [=](Range R) { return R.HighPC() <= Address; });
119119
if (It != Aranges.end() && It->LowPC <= Address)
120120
return It->CUOffset;
121-
return -1U;
121+
return -1ULL;
122122
}

0 commit comments

Comments
 (0)