本文整理汇总了C++中Disassembler::showInst方法的典型用法代码示例。如果您正苦于以下问题:C++ Disassembler::showInst方法的具体用法?C++ Disassembler::showInst怎么用?C++ Disassembler::showInst使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Disassembler
的用法示例。
在下文中一共展示了Disassembler::showInst方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
printf("%s\n", workLoad[k]);
}
break;
}
}
try {
if(!loadOn)
throw 1;
}
catch (int ex) {
errExit("Not WorkLoad");
}
struct sigaction act;
act.sa_handler = int_handler;
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
sigaction(SIGINT, &act, NULL);
// select profiled program
Tracer tracer(workLoad[0], &workLoad[0]);
try {
tracer.traceStart();
}
catch(int exept) {
errExit("trace start");
}
// set Simulator
Simul bSim(tracer.getChildPid(), disAssem, &workLoad[0]);
pbSim = &bSim;
// set predictor
bSim.setPredictor(new NotTaken());
bSim.setPredictor(new TwoBit());
bSim.setPredictor(new Correlate());
bSim.setPredictor(new GShare());
bSim.setPredictor(new GShareRet());
gettimeofday(&startTime, NULL);
/*
** Loop now, tracing the child
*/
while (1) {
/*
** Ok, now we will continue the child, but set the single step bit in
** the psw. This will cause the child to exeute just one instruction and
** trap us again. The wait(2) catches the trap.
*/
try {
tracer.traceSingleStep(infoRegs);
ip = infoRegs.getRIP();
}
catch(int except) {
if(errno == ESRCH) {
cout << "Target Process is terminated...." << endl;
break;
}
errMsg("Single step");
break;
}
try {
bSim.runSimulation(ip);
}
catch(int execpt) {
errMsg("runSimulation\n");
}
if(debugOn)
{
try {
disAssem->showInst(ip, tracer.getChildPid());
}
catch(int ex) {
errMsg("showInst");
}
}
if(limitInst)
{
if(disAssem->typeOfInst(ip, tracer.getChildPid()))
{
numOfBranchInst++;
if(numOfBranchInst >= numOfLimitInst)
break;
}
}
}
gettimeofday(&endTime, NULL);
long endSec = (long)endTime.tv_sec * 1000000 + endTime.tv_usec;
long startSec = (long)startTime.tv_sec * 1000000 + startTime.tv_usec;
bSim.setTime(endSec - startSec);
bSim.printResult(rawOn);
return 0;
}