[PATCH] D58194: [DebugInfo] add SectionedAddress to DebugInfo interfaces.
Alexey Lapshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 15 13:51:54 PST 2019
alexey.lapshin added a comment.
George, I added test for LLD. But.... It already pass for LLD without this fix. The reason for that is following quickfix :
lld/ELF/DWARF.cpp:90
// FIXME: We should be consistent about always adding the file
// offset or not.
if (DR->Section->Flags & ELF::SHF_ALLOC)
Val += cast<InputSection>(DR->Section)->getOffsetInFile();
lld/ELF/InputFiles.cpp:208
// Use fake address calcuated by adding section file offset and offset in
// section. See comments for ObjectInfo class.
DILineInfo Info;
for (const llvm::DWARFDebugLine::LineTable *LT : LineTables)
if (LT->getFileLineInfoForAddress(
S->getOffsetInFile() + Offset, nullptr,
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, Info))
return Info;
FileOffset added instead of section offset(because section offset could be 0). I think that quickfix should not prevent making interfaces full. i.e. I still think that adding SectionIndex for getFileLineInfoForAddress is a right thing. Having this already done - the fix with getOffsetInFile could probably be refactored out.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58194/new/
https://reviews.llvm.org/D58194
More information about the llvm-commits
mailing list