本文整理汇总了C++中DWARFUnit::getDIEAtIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ DWARFUnit::getDIEAtIndex方法的具体用法?C++ DWARFUnit::getDIEAtIndex怎么用?C++ DWARFUnit::getDIEAtIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DWARFUnit
的用法示例。
在下文中一共展示了DWARFUnit::getDIEAtIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: verifyUnitContents
bool DWARFVerifier::verifyUnitContents(DWARFUnit Unit) {
uint32_t NumUnitErrors = 0;
unsigned NumDies = Unit.getNumDIEs();
for (unsigned I = 0; I < NumDies; ++I) {
auto Die = Unit.getDIEAtIndex(I);
if (Die.getTag() == DW_TAG_null)
continue;
NumUnitErrors += verifyDieRanges(Die);
for (auto AttrValue : Die.attributes()) {
NumUnitErrors += verifyDebugInfoAttribute(Die, AttrValue);
NumUnitErrors += verifyDebugInfoForm(Die, AttrValue);
}
}
return NumUnitErrors == 0;
}
示例2: verifyUnitContents
bool DWARFVerifier::verifyUnitContents(DWARFUnit Unit, uint8_t UnitType) {
uint32_t NumUnitErrors = 0;
unsigned NumDies = Unit.getNumDIEs();
for (unsigned I = 0; I < NumDies; ++I) {
auto Die = Unit.getDIEAtIndex(I);
if (Die.getTag() == DW_TAG_null)
continue;
for (auto AttrValue : Die.attributes()) {
NumUnitErrors += verifyDebugInfoAttribute(Die, AttrValue);
NumUnitErrors += verifyDebugInfoForm(Die, AttrValue);
}
}
DWARFDie Die = Unit.getUnitDIE(/* ExtractUnitDIEOnly = */ false);
if (!Die) {
error() << "Compilation unit without DIE.\n";
NumUnitErrors++;
return NumUnitErrors == 0;
}
if (!dwarf::isUnitType(Die.getTag())) {
error() << "Compilation unit root DIE is not a unit DIE: "
<< dwarf::TagString(Die.getTag()) << ".\n";
NumUnitErrors++;
}
if (UnitType != 0 &&
!DWARFUnit::isMatchingUnitTypeAndTag(UnitType, Die.getTag())) {
error() << "Compilation unit type (" << dwarf::UnitTypeString(UnitType)
<< ") and root DIE (" << dwarf::TagString(Die.getTag())
<< ") do not match.\n";
NumUnitErrors++;
}
DieRangeInfo RI;
NumUnitErrors += verifyDieRanges(Die, RI);
return NumUnitErrors == 0;
}