[PATCH] D108497: Fix fallback code that gets decl file + line.
Greg Clayton via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 23 11:06:30 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe100a41bbe61: Fix fallback code that gets decl file + line. (authored by clayborg).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108497/new/
https://reviews.llvm.org/D108497
Files:
llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
Index: llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
===================================================================
--- llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
+++ llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
@@ -260,17 +260,15 @@
if (!CUI.LineTable->lookupAddressRange(SecAddress, RangeSize, RowVector)) {
// If we have a DW_TAG_subprogram but no line entries, fall back to using
// the DW_AT_decl_file an d DW_AT_decl_line if we have both attributes.
- if (auto FileIdx =
- dwarf::toUnsigned(Die.findRecursively({dwarf::DW_AT_decl_file}))) {
- if (auto Line =
- dwarf::toUnsigned(Die.findRecursively({dwarf::DW_AT_decl_line}))) {
- LineEntry LE(StartAddress, CUI.DWARFToGSYMFileIndex(Gsym, *FileIdx),
- *Line);
- FI.OptLineTable = LineTable();
- FI.OptLineTable->push(LE);
- // LE.Addr = EndAddress;
- // FI.OptLineTable->push(LE);
- }
+ std::string FilePath = Die.getDeclFile(
+ DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath);
+ if (FilePath.empty())
+ return;
+ if (auto Line =
+ dwarf::toUnsigned(Die.findRecursively({dwarf::DW_AT_decl_line}))) {
+ LineEntry LE(StartAddress, Gsym.insertFile(FilePath), *Line);
+ FI.OptLineTable = LineTable();
+ FI.OptLineTable->push(LE);
}
return;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108497.368150.patch
Type: text/x-patch
Size: 1374 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210823/544c51ed/attachment.bin>
More information about the llvm-commits
mailing list