本文整理匯總了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++;
}
}