[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 Jan 10 15:21:58 PST 2024


================
@@ -1537,15 +1545,38 @@ DWARFCompileUnit *DWARFContext::getCompileUnitForDataAddress(uint64_t Address) {
   return nullptr;
 }
 
-DWARFContext::DIEsForAddress DWARFContext::getDIEsForAddress(uint64_t Address) {
+DWARFContext::DIEsForAddress DWARFContext::getDIEsForAddress(uint64_t Address,
+                                                             bool CheckDWO) {
   DIEsForAddress Result;
 
   DWARFCompileUnit *CU = getCompileUnitForCodeAddress(Address);
   if (!CU)
     return Result;
 
-  Result.CompileUnit = CU;
-  Result.FunctionDIE = CU->getSubroutineForAddress(Address);
+  if (CheckDWO) {
+    // We were asked to check the DWO file and this debug information is more
+    // complete that any information in the skeleton compile unit, so search the
+    // DWO first to see if we have a match.
+    DWARFDie CUDie = CU->getUnitDIE(false);
+    DWARFDie CUDwoDie = CU->getNonSkeletonUnitDIE(false);
+    if (CheckDWO && CUDwoDie && CUDie != CUDwoDie) {
----------------
dwblaikie wrote:

No need to `CheckDWO` again here, as we're inside an `if (CheckDWO)` at this point.

https://github.com/llvm/llvm-project/pull/66726


More information about the llvm-commits mailing list