本文整理汇总了C++中Proc::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Proc::size方法的具体用法?C++ Proc::size怎么用?C++ Proc::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Proc
的用法示例。
在下文中一共展示了Proc::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: begVMA
// Disassemble the instructions in each procedure
void
BinUtil::TextSeg::ctor_disassembleProcs()
{
// ------------------------------------------------------------
// Disassemble the instructions in each procedure.
// ------------------------------------------------------------
VMA sectionBase = begVMA();
for (ProcVec::iterator it = m_procs.begin(); it != m_procs.end(); ++it) {
Proc* p = *it;
VMA procBeg = p->begVMA();
VMA procEnd = p->endVMA();
ushort insnSz = 0;
VMA lastInsnVMA = procBeg; // vma of last valid instruction in the proc
// Iterate over each vma at which an instruction might begin
for (VMA vma = procBeg; vma < procEnd; ) {
MachInsn *mi = &(m_contents[vma - sectionBase]);
insnSz = LM::isa->getInsnSize(mi);
if (insnSz == 0) {
// This is not a recognized instruction (cf. data on CISC ISAs).
++vma; // Increment the VMA, and try to decode again.
continue;
}
int num_ops = LM::isa->getInsnNumOps(mi);
if (num_ops == 0) {
// This instruction contains data. No need to decode.
vma += insnSz;
continue;
}
// We have a valid instruction at this vma!
lastInsnVMA = vma;
for (ushort opIndex = 0; opIndex < num_ops; opIndex++) {
Insn *newInsn = makeInsn(m_lm->abfd(), mi, vma, opIndex, insnSz);
m_lm->insertInsn(vma, opIndex, newInsn);
}
vma += insnSz;
}
// 'insnSz' is now the size of the last instruction or 0
// Now we can update the procedure's end address and size since we
// know where the last instruction begins. The procedure's
// original end address was guessed to be the begin address of the
// following procedure while determining all procedures above.
p->endVMA(lastInsnVMA);
p->size(p->endVMA() - p->begVMA() + insnSz);
}
}