ppc: update ppc.bh in post-printer
This commit is contained in:
parent
91e532d5ab
commit
2b14fcdf9b
|
@ -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
|
#define GET_INSTRINFO_ENUM
|
||||||
#include "PPCGenInstrInfo.inc"
|
#include "PPCGenInstrInfo.inc"
|
||||||
|
|
||||||
|
|
|
@ -10,4 +10,6 @@
|
||||||
|
|
||||||
void PPC_printInst(MCInst *MI, SStream *O, void *Info);
|
void PPC_printInst(MCInst *MI, SStream *O, void *Info);
|
||||||
|
|
||||||
|
void PPC_post_printer(csh ud, cs_insn *insn, char *insn_asm);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -17,6 +17,7 @@ static cs_err init(cs_struct *ud)
|
||||||
ud->printer_info = mri;
|
ud->printer_info = mri;
|
||||||
ud->getinsn_info = mri;
|
ud->getinsn_info = mri;
|
||||||
ud->disasm = PPC_getInstruction;
|
ud->disasm = PPC_getInstruction;
|
||||||
|
ud->post_printer = PPC_post_printer;
|
||||||
|
|
||||||
ud->reg_name = PPC_reg_name;
|
ud->reg_name = PPC_reg_name;
|
||||||
ud->insn_id = PPC_get_insn_id;
|
ud->insn_id = PPC_get_insn_id;
|
||||||
|
|
Loading…
Reference in New Issue