ocaml: properly handle newly added mode CS_MODE_V8 & PPC_OP_CRX in test_ppc.ml

test2
Nguyen Anh Quynh 10 years ago
parent 9ba1906470
commit 7b7d7455b0
  1. 13
      bindings/ocaml/ocaml.c
  2. 8
      bindings/ocaml/test_ppc.ml

@ -811,21 +811,24 @@ CAMLprim value ocaml_open(value _arch, value _mode)
mode |= CS_MODE_MCLASS;
break;
case 7:
mode |= CS_MODE_MICRO;
mode |= CS_MODE_V8;
break;
case 8:
mode |= CS_MODE_MIPS3;
mode |= CS_MODE_MICRO;
break;
case 9:
mode |= CS_MODE_MIPS32R6;
mode |= CS_MODE_MIPS3;
break;
case 10:
mode |= CS_MODE_MIPSGP64;
mode |= CS_MODE_MIPS32R6;
break;
case 11:
mode |= CS_MODE_V9;
mode |= CS_MODE_MIPSGP64;
break;
case 12:
mode |= CS_MODE_V9;
break;
case 13:
mode |= CS_MODE_BIG_ENDIAN;
break;
default:

@ -31,6 +31,14 @@ let print_op handle i op =
if mem.disp != 0 then
printf "\t\t\toperands[%u].mem.disp: 0x%x\n" i mem.disp;
);
| PPC_OP_CRX crx -> ( printf "\t\top[%d]: CRX\n" i;
if crx.scale != 0 then
printf "\t\t\toperands[%u].crx.scale = %u\n" i crx.scale;
if crx.reg != 0 then
printf "\t\t\toperands[%u].crx.reg = %s\n" i (cs_reg_name handle crx.reg);
if crx.cond != 0 then
printf "\t\t\toperands[%u].crx.cond = 0x%x\n" i crx.cond;
);
);
();;

Loading…
Cancel
Save