本文整理汇总了C++中DIInliningInfo::getMutableFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ DIInliningInfo::getMutableFrame方法的具体用法?C++ DIInliningInfo::getMutableFrame怎么用?C++ DIInliningInfo::getMutableFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIInliningInfo
的用法示例。
在下文中一共展示了DIInliningInfo::getMutableFrame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getOrCreateModuleInfo
ErrorOr<DIInliningInfo>
LLVMSymbolizer::symbolizeInlinedCode(const std::string &ModuleName,
uint64_t ModuleOffset) {
auto InfoOrErr = getOrCreateModuleInfo(ModuleName);
if (auto EC = InfoOrErr.getError())
return EC;
SymbolizableModule *Info = InfoOrErr.get();
// If the user is giving us relative addresses, add the preferred base of the
// object to the offset before we do the query. It's what DIContext expects.
if (Opts.RelativeAddresses)
ModuleOffset += Info->getModulePreferredBase();
DIInliningInfo InlinedContext = Info->symbolizeInlinedCode(
ModuleOffset, Opts.PrintFunctions, Opts.UseSymbolTable);
if (Opts.Demangle) {
for (int i = 0, n = InlinedContext.getNumberOfFrames(); i < n; i++) {
auto *Frame = InlinedContext.getMutableFrame(i);
Frame->FunctionName = DemangleName(Frame->FunctionName, Info);
}
}
return InlinedContext;
}
示例2: symbolizeInlinedCode
DIInliningInfo SymbolizableObjectFile::symbolizeInlinedCode(
uint64_t ModuleOffset, FunctionNameKind FNKind, bool UseSymbolTable) const {
DIInliningInfo InlinedContext;
if (DebugInfoContext)
InlinedContext = DebugInfoContext->getInliningInfoForAddress(
ModuleOffset, getDILineInfoSpecifier(FNKind));
// Make sure there is at least one frame in context.
if (InlinedContext.getNumberOfFrames() == 0)
InlinedContext.addFrame(DILineInfo());
// Override the function name in lower frame with name from symbol table.
if (shouldOverrideWithSymbolTable(FNKind, UseSymbolTable)) {
std::string FunctionName;
uint64_t Start, Size;
if (getNameFromSymbolTable(SymbolRef::ST_Function, ModuleOffset,
FunctionName, Start, Size)) {
InlinedContext.getMutableFrame(InlinedContext.getNumberOfFrames() - 1)
->FunctionName = FunctionName;
}
}
return InlinedContext;
}