[PATCH] D32228: [DWARF] - Take relocations in account when extracting ranges from .debug_ranges
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 19 08:35:33 PDT 2017
dblaikie added inline comments.
================
Comment at: lib/DebugInfo/DWARF/DWARFDebugRangeList.cpp:25-31
+static uint64_t getAddress(DataExtractor &Data, uint32_t *Off,
+ const RelocAddrMap &Relocs) {
+ RelocAddrMap::const_iterator AI = Relocs.find(*Off);
+ if (AI != Relocs.end())
+ return Data.getAddress(Off) + AI->second.second;
+ return Data.getAddress(Off);
+}
----------------
Should/can/could this be refactored to use the same code as the case you mentioned was already in place for DW_FORM_addr (high/low pc)?
================
Comment at: test/DebugInfo/dwarfdump-ranges-unrelocated.s:13-15
+# int foo1() { return 1; }
+# int foo2() { return 1; }
+# int foo3() { return 1; }
----------------
Would 2 functions (also probably simpler for them to be void and empty functions) would suffice to give the CU a DW_AT_ranges rather than high/low pc?
https://reviews.llvm.org/D32228
More information about the llvm-commits
mailing list