This patch makes the 'Length' field of the address range table optional.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/ObjectYAML/DWARFEmitter.cpp | ||
---|---|---|
147 | Shouldn't there be a SegmentSelectorSize calculation here too? .debug_aranges defines how to actually use the property, so we should probably do the right calculation here. | |
149 | I think @MaskRay is suggesting: if (Range.Length) { Length = *Range.Length; } else { Length += PaddedHeaderLength - HeaderLength; Length += AddrSize * 2 * (Range.Descriptors.size() + 1); } Since this if overrides Length, and there are no side effects to the += calculations before, there's no reason to do them at all in the if case. | |
llvm/test/tools/yaml2obj/ELF/DWARF/debug-aranges.yaml | ||
514–515 | You probably need a variation of this test with a different non-default address size (e.g. 8 for a 32-bit object), to show that the length accounts for the right size. Same applies for the segment selector size. |
llvm/test/tools/yaml2obj/ELF/DWARF/debug-aranges.yaml | ||
---|---|---|
514–515 | Currently, yaml2obj doesn't support emitting the segment selector for the address range table. Shall I implement it before this patch? |
llvm/test/tools/yaml2obj/ELF/DWARF/debug-aranges.yaml | ||
---|---|---|
514–515 | No need to do it before unless you want to (this patch is more useful). You can add it afterwards - just make sure to fix this code path when you do! |
const uint64_t PaddedHeaderLength