本文整理汇总了C++中DWARFDebugInfoEntry::extractFast方法的典型用法代码示例。如果您正苦于以下问题:C++ DWARFDebugInfoEntry::extractFast方法的具体用法?C++ DWARFDebugInfoEntry::extractFast怎么用?C++ DWARFDebugInfoEntry::extractFast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DWARFDebugInfoEntry
的用法示例。
在下文中一共展示了DWARFDebugInfoEntry::extractFast方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: extractDIEsToVector
void DWARFUnit::extractDIEsToVector(
bool AppendCUDie, bool AppendNonCUDies,
std::vector<DWARFDebugInfoEntry> &Dies) const {
if (!AppendCUDie && !AppendNonCUDies)
return;
// Set the offset to that of the first DIE and calculate the start of the
// next compilation unit header.
uint32_t DIEOffset = getOffset() + getHeaderSize();
uint32_t NextCUOffset = getNextUnitOffset();
DWARFDebugInfoEntry DIE;
DWARFDataExtractor DebugInfoData = getDebugInfoExtractor();
uint32_t Depth = 0;
bool IsCUDie = true;
while (DIE.extractFast(*this, &DIEOffset, DebugInfoData, NextCUOffset,
Depth)) {
if (IsCUDie) {
if (AppendCUDie)
Dies.push_back(DIE);
if (!AppendNonCUDies)
break;
// The average bytes per DIE entry has been seen to be
// around 14-20 so let's pre-reserve the needed memory for
// our DIE entries accordingly.
Dies.reserve(Dies.size() + getDebugInfoSize() / 14);
IsCUDie = false;
} else {
Dies.push_back(DIE);
}
if (const DWARFAbbreviationDeclaration *AbbrDecl =
DIE.getAbbreviationDeclarationPtr()) {
// Normal DIE
if (AbbrDecl->hasChildren())
++Depth;
} else {
// NULL DIE.
if (Depth > 0)
--Depth;
if (Depth == 0)
break; // We are done with this compile unit!
}
}
// Give a little bit of info if we encounter corrupt DWARF (our offset
// should always terminate at or before the start of the next compilation
// unit header).
if (DIEOffset > NextCUOffset)
WithColor::warning() << format("DWARF compile unit extends beyond its "
"bounds cu 0x%8.8x at 0x%8.8x\n",
getOffset(), DIEOffset);
}