Lines Matching +full:- +full:- +full:require +full:- +full:hashes

1 //===- DWARFUnit.cpp ------------------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
78 -> std::unique_ptr<DWARFUnit> { in addUnitsImpl()
123 // but with lower offset-within-section. This keeps units in order in addUnitsImpl()
126 auto I = this->begin(); in addUnitsImpl()
129 if (I != this->end() && in addUnitsImpl()
130 (&(*I)->getInfoSection() != &Section || (*I)->getOffset() == Offset)) { in addUnitsImpl()
138 Offset = U->getNextUnitOffset(); in addUnitsImpl()
139 I = std::next(this->insert(I, std::move(U))); in addUnitsImpl()
147 return LHS->getOffset() < RHS->getOffset(); in addUnit()
149 return this->insert(I, std::move(Unit))->get(); in addUnit()
157 return LHS < RHS->getNextUnitOffset(); in getUnitForOffset()
159 if (CU != end && (*CU)->getOffset() <= Offset) in getUnitForOffset()
160 return CU->get(); in getUnitForOffset()
170 uint64_t Offset = CUOff->getOffset(); in getUnitForIndexEntry()
174 std::upper_bound(begin(), end, CUOff->getOffset(), in getUnitForIndexEntry()
176 return LHS < RHS->getNextUnitOffset(); in getUnitForIndexEntry()
178 if (CU != end && (*CU)->getOffset() <= Offset) in getUnitForIndexEntry()
179 return CU->get(); in getUnitForIndexEntry()
189 this->insert(CU, std::move(U)); in getUnitForIndexEntry()
218 // Surprising if a DWO file has more than one skeleton unit in it - this in getAddrOffsetSectionItem()
223 return (*R.begin())->getAddrOffsetSectionItem(Index); in getAddrOffsetSectionItem()
229 if (AddrOffsetSection->Data.size() < Offset + getAddressByteSize()) in getAddrOffsetSectionItem()
295 assert(*offset_ptr - Offset <= 255 && "unexpected header size"); in extract()
296 Size = uint8_t(*offset_ptr - Offset); in extract()
299 if (!debug_info.isValidOffset(getNextUnitOffset() - 1)) in extract()
310 "has unsupported version %" PRIu16 ", supported are 2-%u", in extract()
313 // Type offset is unit-relative; should be after the header and before in extract()
348 " has a non-zero abbreviation offset", in applyIndexEntry()
351 auto *UnitContrib = IndexEntry->getContribution(); in applyIndexEntry()
359 if (UnitContrib->getLength() != IndexLength) in applyIndexEntry()
364 Offset, UnitContrib->getLength(), IndexLength); in applyIndexEntry()
366 auto *AbbrEntry = IndexEntry->getContribution(DW_SECT_ABBREV); in applyIndexEntry()
373 AbbrOffset = AbbrEntry->getOffset(); in applyIndexEntry()
379 // Require that compile unit is extracted. in extractRangeList()
397 DWO->clear(); in clear()
418 assert(DebugInfoData.isValidOffset(NextCUOffset - 1)); in extractDIEsToVector()
458 // around 14-20 so let's pre-reserve the needed memory for in extractDIEsToVector()
471 if (AbbrDecl->hasChildren()) { in extractDIEsToVector()
474 Parents.push_back(Dies.size() - 1); in extractDIEsToVector()
558 if (auto *Contrib = IndexEntry->getContribution(DW_SECT_RNGLISTS)) in tryExtractDIEsIfNeeded()
559 ContributionBaseOffset = Contrib->getOffset(); in tryExtractDIEsIfNeeded()
578 if (const auto *C = IndexEntry->getContribution( in tryExtractDIEsIfNeeded()
580 Data = Data.substr(C->getOffset(), C->getLength()); in tryExtractDIEsIfNeeded()
632 // (different hashes), the below 'getDWOCompileUnitForHash' call will catch in parseDWO()
639 DWARFCompileUnit *DWOCU = DWOContext->getDWOCompileUnitForHash(*DWOId); in parseDWO()
643 DWO->setSkeletonUnit(this); in parseDWO()
646 DWO->setAddrOffsetSection(AddrOffsetSection, *AddrOffsetSectionBase); in parseDWO()
649 DWO->setRangesSection(RangeSection, DWORangesBase.value_or(0)); in parseDWO()
657 // shrink_to_fit() is a *non-binding* request to reduce capacity() to size(). in clearDIEs()
737 // Ignore 0-sized ranges. in updateAddressDieMap()
741 if (B != AddrDieMap.begin() && R.LowPC < (--B)->second.first) { in updateAddressDieMap()
742 // The range is a sub-range of existing ranges, we need to split the in updateAddressDieMap()
744 if (R.HighPC < B->second.first) in updateAddressDieMap()
745 AddrDieMap[R.HighPC] = B->second; in updateAddressDieMap()
746 if (R.LowPC > B->first) in updateAddressDieMap()
747 AddrDieMap[B->first].first = R.LowPC; in updateAddressDieMap()
758 // sub-ranges. in updateAddressDieMap()
771 --R; in getSubroutineForAddress()
772 if (Address >= R->second.first) in getSubroutineForAddress()
774 return R->second.second; in getSubroutineForAddress()
812 if (It->getCode() == dwarf::DW_OP_addr) { in updateVariableDieMap()
813 LocationAddr = It->getRawOperand(0); in updateVariableDieMap()
814 } else if (It->getCode() == dwarf::DW_OP_addrx) { in updateVariableDieMap()
815 uint64_t DebugAddrOffset = It->getRawOperand(0); in updateVariableDieMap()
817 LocationAddr = Pointer->Address; in updateVariableDieMap()
825 if (It->getCode() != dwarf::DW_OP_plus_uconst) in updateVariableDieMap()
828 LocationAddr += It->getRawOperand(0); in updateVariableDieMap()
865 --R; in getVariableForAddress()
866 if (Address >= R->second.first) in getVariableForAddress()
868 return R->second.second; in getVariableForAddress()
914 if (std::optional<uint32_t> ParentIdx = Die->getParentIdx()) { in getParentEntry()
936 if (std::optional<uint32_t> SiblingIdx = Die->getSiblingIdx()) { in getSiblingEntry()
958 std::optional<uint32_t> ParentIdx = Die->getParentIdx(); in getPreviousSiblingEntry()
967 uint32_t PrevDieIdx = getDIEIndex(Die) - 1; in getPreviousSiblingEntry()
997 if (!Die->hasChildren()) in getFirstChildEntry()
1022 if (!Die->hasChildren()) in getLastChildEntry()
1025 if (std::optional<uint32_t> SiblingIdx = Die->getSiblingIdx()) { in getLastChildEntry()
1028 assert(DieArray[*SiblingIdx - 1].getTag() == dwarf::DW_TAG_null && in getLastChildEntry()
1030 return &DieArray[*SiblingIdx - 1]; in getLastChildEntry()
1033 // If SiblingIdx is set for non-root dies we could be sure that DWARF is in getLastChildEntry()
1046 getDIEIndex(const_cast<DWARFUnit *>(this)->getUnitDIE()) && in getLastChildEntry()
1057 Abbrev->getAbbreviationDeclarationSet(getAbbreviationsOffset()); in getAbbreviations()
1072 DWARFDie UnitDie = (SU ? SU : this)->getUnitDIE(); in getBaseAddress()
1093 // Look for a DWARF64-formatted contribution to the string offsets table
1106 // The encoded length includes the 2-byte version field and the 2-byte in parseDWARF64StringOffsetsTableHeader()
1108 return StrOffsetsContributionDescriptor(Offset, Size - 4, Version, DWARF64); in parseDWARF64StringOffsetsTableHeader()
1111 // Look for a DWARF32-formatted contribution to the string offsets table
1124 // The encoded length includes the 2-byte version field and the 2-byte in parseDWARF32StringOffsetsTableHeader()
1126 return StrOffsetsContributionDescriptor(Offset, ContributionSize - 4, Version, in parseDWARF32StringOffsetsTableHeader()
1139 auto DescOrError = parseDWARF64StringOffsetsTableHeader(DA, Offset - 16); in parseDWARFStringOffsetsTableHeader()
1148 auto DescOrError = parseDWARF32StringOffsetsTableHeader(DA, Offset - 8); in parseDWARFStringOffsetsTableHeader()
1177 IndexEntry ? IndexEntry->getContribution(DW_SECT_STR_OFFSETS) : nullptr; in determineStringOffsetsTableContributionDWO()
1179 Offset = C->getOffset(); in determineStringOffsetsTableContributionDWO()
1195 Desc = StrOffsetsContributionDescriptor(C->getOffset(), C->getLength(), 4, in determineStringOffsetsTableContributionDWO()
1209 DataExtractor RangesData(RangeSection->Data, IsLittleEndian, in getRnglistOffset()
1221 LocTable->getData(), LocSectionBase, getFormat(), Index)) in getLoclistOffset()