[Lldb-commits] [PATCH] D52375: [WIP] Support multiple compile units per OSO entry in SymbolFileDWARFDebugMap

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 25 15:16:23 PDT 2018


clayborg added inline comments.


================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp:425
   const DWARFDebugInfoEntry *die = GetUnitDIEPtrOnly();
 
   const dw_offset_t cu_offset = GetOffset();
----------------
Following from inline comment below, you can abort if this CU is empty:

```
// If this DWARF unit has no children, we have no address ranges to add. If
// something is built with line tables only, there will still be function DIEs with
// address ranges as children.
if (!die->HasChildren())
  return;
```


================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp:439
+        die->GetAttributeAddressRanges(dwarf, this, ranges, check_hi_lo_pc);
+
     if (num_ranges > 0) {
----------------
Empty CUs won't have any children. Easy to skip by getting the CU die and doing:
```
if (!die->HasChildren())
```



================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp:488-489
         }
-      } else
-        debug_map_sym_file->AddOSOARanges(dwarf, debug_aranges);
+      } //else
+        //debug_map_sym_file->AddOSOARanges(dwarf, debug_aranges);
     }
----------------
revert if the "if (!die->hasChildren())" trick works.


https://reviews.llvm.org/D52375





More information about the lldb-commits mailing list