ppc: update ppc.bh in post-printer

This commit is contained in:
Nguyen Anh Quynh 2014-01-05 10:37:50 +08:00
parent 91e532d5ab
commit 2b14fcdf9b
3 changed files with 16 additions and 0 deletions

View File

@ -52,6 +52,19 @@ static void set_mem_access(MCInst *MI, bool status)
}
}
void PPC_post_printer(csh ud, cs_insn *insn, char *insn_asm)
{
if (((cs_struct *)ud)->detail != CS_OPT_ON)
return;
// check if this insn has branch hint
if (strrchr(insn_asm, '+') != NULL) {
insn->detail->ppc.bh = PPC_BH_PLUS;
} else if (strrchr(insn_asm, '-') != NULL) {
insn->detail->ppc.bh = PPC_BH_MINUS;
}
}
#define GET_INSTRINFO_ENUM
#include "PPCGenInstrInfo.inc"

View File

@ -10,4 +10,6 @@
void PPC_printInst(MCInst *MI, SStream *O, void *Info);
void PPC_post_printer(csh ud, cs_insn *insn, char *insn_asm);
#endif

View File

@ -17,6 +17,7 @@ static cs_err init(cs_struct *ud)
ud->printer_info = mri;
ud->getinsn_info = mri;
ud->disasm = PPC_getInstruction;
ud->post_printer = PPC_post_printer;
ud->reg_name = PPC_reg_name;
ud->insn_id = PPC_get_insn_id;