本文整理汇总了C++中Breakpoint::saved_instruction方法的典型用法代码示例。如果您正苦于以下问题:C++ Breakpoint::saved_instruction方法的具体用法?C++ Breakpoint::saved_instruction怎么用?C++ Breakpoint::saved_instruction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Breakpoint
的用法示例。
在下文中一共展示了Breakpoint::saved_instruction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dissemble
void dissemble(PFBlock fb)
{
Opcodes opcode;
int rmode,rdata, k = 0;
string name;
Instruction *pi = fb->pstart;
while (pi != end_of_code) {
opcode = (Opcodes)pi->opcode;
// *add 1.2.4 HALT+data is not always a breakpoint!
// (it is used as a NOP + <any useful tag data>)
if (opcode == HALT) {
if (pi->data < MAX_BREAKPOINTS) {
Breakpoint *pb = Breakpoint::from_id(pi->data);
Instruction ai = pb->saved_instruction();
std::cout << "*";
opcode = (Opcodes)ai.opcode;
rmode = ai.rmode; rdata = ai.data;
} else { opcode = NOP; rdata = pi->data; }
} else {
rmode = pi->rmode; rdata = pi->data;
}
name = get_opcode_name(opcode);
std::cout << k++ << ' ' << name << '\t';
if (opcode == CCALL || opcode == CALL || opcode == CALLD || opcode == CALLN) {
FBlock* pfb;
void *data = data_ptr(rdata);
if (opcode == CALLN)
pfb = Builtin::imported_fblock_from_function((void*)((NFBlock *)data)->pfn);
else pfb = PFBlock(data_ptr(rdata));
if (pfb) Function::from_fun_block(pfb)->dump(std::cout);
} else
if (opcode == JSWITCH) {
int *swb = (int *)data_ptr(rdata);
int sz = *swb++;
int def = *swb++;
std::cout << '(' << sz << ',' << def << ") ";
for (int i = 0; i < sz; i++) std::cout << *swb++ << ' ' << *swb++ << ' ';
}
else
if (opcode == TOSD || opcode == TPODS) {
PClass pc = *(PClass *)data_ptr(rdata);
std::cout << pc->name();
}
else {
if (rmode)
switch(rmode) {
case DIRECT: std::cout << "D "; break;
case SREL: std::cout << "R "; break;
case OREL: std::cout << "S "; break;
}
if (rdata != 0) std::cout << rdata;
}
std::cout << std::endl;
if (opcode == RET || opcode == RETI || opcode == RETD) break;
pi++;
}
}