- uint64_t AbbrCode = DebugInfoData.getULEB128(OffsetPtr);
- if (0 == AbbrCode) {
- // NULL debug tag entry.
- AbbrevDecl = NULL;
- return true;
- }
- AbbrevDecl = U->getAbbreviations()->getAbbreviationDeclaration(AbbrCode);
- assert(AbbrevDecl);
- assert(FixedFormSizes); // For best performance this should be specified!
-
- // Skip all data in the .debug_info for the attributes
- for (uint32_t i = 0, n = AbbrevDecl->getNumAttributes(); i < n; ++i) {
- uint16_t Form = AbbrevDecl->getFormByIndex(i);
-
- // FIXME: Currently we're checking if this is less than the last
- // entry in the fixed_form_sizes table, but this should be changed
- // to use dynamic dispatch.
- uint8_t FixedFormSize =
- (Form < DW_FORM_ref_sig8) ? FixedFormSizes[Form] : 0;
- if (FixedFormSize)
- *OffsetPtr += FixedFormSize;
- else if (!DWARFFormValue::skipValue(Form, DebugInfoData, OffsetPtr,
- U)) {
- // Restore the original offset.
- *OffsetPtr = Offset;
- return false;
- }
- }
- return true;
-}
-
-bool DWARFDebugInfoEntryMinimal::extract(const DWARFUnit *U,
- uint32_t *OffsetPtr) {
- DataExtractor DebugInfoData = U->getDebugInfoExtractor();
- const uint32_t UEndOffset = U->getNextUnitOffset();
- Offset = *OffsetPtr;
- if ((Offset >= UEndOffset) || !DebugInfoData.isValidOffset(Offset))