本文整理汇总了C++中Proc::filename方法的典型用法代码示例。如果您正苦于以下问题:C++ Proc::filename方法的具体用法?C++ Proc::filename怎么用?C++ Proc::filename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Proc
的用法示例。
在下文中一共展示了Proc::filename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
Dbg::LM::iterator it = dbgInfo->find(begVMA);
Dbg::Proc* dbg = (it != dbgInfo->end()) ? it->second : NULL;
if (!dbg) {
procNm = findProcName(abfd, sym);
string pnm = BinUtil::canonicalizeProcName(procNm);
Dbg::LM::iterator1 it1 = dbgInfo->find1(pnm);
dbg = (it1 != dbgInfo->end1()) ? it1->second : NULL;
}
if (!dbg) {
Dbg::LM::iterator1 it1 = dbgInfo->find1(symNm);
dbg = (it1 != dbgInfo->end1()) ? it1->second : NULL;
}
// Finding the end VMA (end of last insn). The computation is
// as follows because sometimes the debug information is
// *wrong*. (Intel 9 has generated significant over-estimates).
//
// N.B. exploits the fact that the symbol table is sorted by vma
VMA endVMA_approx = findProcEnd(i);
if (dbg) {
if (!dbg->name.empty()) {
procNm = dbg->name;
}
else if (!symNm.empty()) {
// sometimes a procedure name is in the symbol table even
// though it is not in the dwarf section. this case occurs
// when gcc outlines routines from OpenMP parallel sections.
procNm = symNm;
}
#if 1
// Remove capability below... the DWARF sizes can be wrong!!
endVMA = endVMA_approx;
#else
endVMA = std::min(dbg->endVMA, endVMA_approx);
if (endVMA != endVMA_approx) {
int64_t diff = endVMA - endVMA_approx;
DIAG_DevMsg(0, procNm << ": inconsistent end VMA: " << diff << " [" << std::showbase << std::hex << begVMA << "-" << endVMA << "/" << endVMA_approx << std::dec << "]");
}
#endif
}
if (!dbg || endVMA == 0) {
endVMA = endVMA_approx;
}
uint size = endVMA - begVMA;
if (size == 0) {
continue;
}
// We now have a valid procedure. Initilize with [begVMA, endVMA),
// but note this is changed after disassembly.
proc = new Proc(this, procNm, symNm, procType, begVMA, endVMA, size);
m_procs.push_back(proc);
m_lm->insertProc(VMAInterval(begVMA, endVMA), proc);
// Add symbolic info
if (dbg) {
proc->filename(dbg->filenm);
proc->begLine(dbg->begLine);
if (dbg->parent) {
parentMap.insert(std::make_pair(proc, dbg->parent->begVMA));
}
}
}
}
// ------------------------------------------------------------
// If a text section does not have any function symbols, consider
// the whole section a quasi procedure
// ------------------------------------------------------------
if (numProcs() == 0) {
// [begVMA, endVMA)
Proc* proc = new Proc(this, name(), name(), Proc::Quasi,
begVMA(), endVMA(), size());
m_procs.push_back(proc);
m_lm->insertProc(VMAInterval(begVMA(), endVMA()), proc);
}
// ------------------------------------------------------------
// Embed parent information
// ------------------------------------------------------------
for (std::map<Proc*, VMA>::iterator it = parentMap.begin();
it != parentMap.end(); ++it) {
Proc* child = it->first;
VMA parentVMA = it->second;
Proc* parent = m_lm->findProc(parentVMA);
DIAG_AssertWarn(parent, "Could not find parent within this section:\n"
<< child->toString());
if (parent == child) {
DIAG_WMsg(0, "Procedure has itself as parent!\n" << child->toString());
continue; // skip
}
child->parent(parent);
}
}