This structure was used to get the size of the fixed-size part of a Name Index header for 32-bit DWARF. It is unsuitable for 64-bit DWARF because the size of the unit length field is different.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Is there any way we can test this?
llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp | ||
---|---|---|
394 | How does this solve the issue exactly? Aren't we still checking the DWARF32 case only? I would expect something like HeaderSize = dwarf::getUnitLengthFieldByteSize(IsDWARF64 ? dwarf::DWARF64 : dwarf::DWARF32) + CommonHeaderSize; but maybe I'm misunderstanding what's going on here? |
llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp | ||
---|---|---|
394 | This is an extract from D72900 where all DWARF64 stuff is added. I made a set of patches so that each of them is more focused. This particular patch merely removes using of sizeof because we have to change the type of the Length to support DWARF64, after which the in-memory structure will anyway not reflect the in-file one. As for your code sample, we check the remaining length of the section before reading fields, but know the format only after reading the first field, Length. |
LGTM.
@JDevlieghere this would be an NFC refactor IMO, so not expecting a test here. The idea is to make D72900 easier to review.
How does this solve the issue exactly? Aren't we still checking the DWARF32 case only? I would expect something like
but maybe I'm misunderstanding what's going on here?