+ "bounds cu 0x%8.8x at 0x%8.8x'\n", getOffset(), Offset);
+}
+
+size_t DWARFCompileUnit::extractDIEsIfNeeded(bool CUDieOnly) {
+ if ((CUDieOnly && DieArray.size() > 0) ||
+ DieArray.size() > 1)
+ return 0; // Already parsed.
+
+ extractDIEsToVector(DieArray.empty(), !CUDieOnly, DieArray);
+
+ // Set the base address of current compile unit.
+ if (!DieArray.empty()) {
+ uint64_t BaseAddr =
+ DieArray[0].getAttributeValueAsUnsigned(this, DW_AT_low_pc, -1U);
+ if (BaseAddr == -1U)
+ BaseAddr = DieArray[0].getAttributeValueAsUnsigned(this, DW_AT_entry_pc, 0);
+ setBaseAddress(BaseAddr);
+ }