[llvm] Allow the dumping of .dwo files contents to show up when dumping an e… (PR #66726)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 15 17:01:59 PST 2023
================
@@ -399,6 +408,21 @@ static void filterByName(
if (const char *Name = Die.getName(DINameKind::LinkageName))
filterByName(Names, Die, Name, OS, GetNameForDWARFReg);
}
+ // If we have split DWARF, then recurse down into the .dwo files as well.
+ DWARFDie CUDie = CU->getUnitDIE(false);
+ DWARFDie CUNonSkeletonDie = CU->getNonSkeletonUnitDIE(false);
+ if (CUNonSkeletonDie && CUDie != CUNonSkeletonDie) {
+ // We have a DWO file, we need to search it as well
+ for (const auto &Entry : CUNonSkeletonDie.getDwarfUnit()->dies()) {
+ DWARFDie Die = {CUNonSkeletonDie.getDwarfUnit(), &Entry};
+ if (const char *Name = Die.getShortName())
+ if (filterByName(Names, Die, Name, OS, GetNameForDWARFReg))
+ continue;
+ if (const char *Name = Die.getLinkageName())
+ filterByName(Names, Die, Name, OS, GetNameForDWARFReg);
+ }
----------------
dwblaikie wrote:
Perhaps put this in a lambda and reuse it from both sites, rather than duplicating it from th enon-split case?
https://github.com/llvm/llvm-project/pull/66726
More information about the llvm-commits
mailing list