mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-24 14:09:56 +00:00
tests: simplify some accesses to insn's details, and fix some typo bugs
This commit is contained in:
parent
fa02175fba
commit
f122ae0629
@ -85,7 +85,7 @@ static void print_insn_detail(cs_insn *ins)
|
||||
}
|
||||
|
||||
if (arm->cc != ARM_CC_AL && arm->cc != ARM_CC_INVALID)
|
||||
printf("\tCode condition: %u\n", ins->detail->arm.cc);
|
||||
printf("\tCode condition: %u\n", arm->cc);
|
||||
|
||||
if (arm->update_flags)
|
||||
printf("\tUpdate-flags: True\n");
|
||||
|
@ -173,28 +173,29 @@ static void test()
|
||||
i->id, cs_insn_name(handle, i->id));
|
||||
|
||||
// print implicit registers used by this instruction
|
||||
if (i->detail->regs_read_count > 0) {
|
||||
cs_detail *detail = i->detail;
|
||||
if (detail->regs_read_count > 0) {
|
||||
printf("\tImplicit registers read: ");
|
||||
for (n = 0; n < i->detail->regs_read_count; n++) {
|
||||
printf("%s ", cs_reg_name(handle, i->detail->regs_read[n]));
|
||||
for (n = 0; n < detail->regs_read_count; n++) {
|
||||
printf("%s ", cs_reg_name(handle, detail->regs_read[n]));
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
// print implicit registers modified by this instruction
|
||||
if (i->detail->regs_write_count > 0) {
|
||||
if (detail->regs_write_count > 0) {
|
||||
printf("\tImplicit registers modified: ");
|
||||
for (n = 0; n < i->detail->regs_write_count; n++) {
|
||||
printf("%s ", cs_reg_name(handle, i->detail->regs_write[n]));
|
||||
for (n = 0; n < detail->regs_write_count; n++) {
|
||||
printf("%s ", cs_reg_name(handle, detail->regs_write[n]));
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
// print the groups this instruction belong to
|
||||
if (i->detail->groups_count > 0) {
|
||||
if (detail->groups_count > 0) {
|
||||
printf("\tThis instruction belongs to groups: ");
|
||||
for (n = 0; n < i->detail->groups_count; n++) {
|
||||
printf("%u ", i->detail->groups[n]);
|
||||
for (n = 0; n < detail->groups_count; n++) {
|
||||
printf("%u ", detail->groups[n]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
@ -60,10 +60,10 @@ static void print_insn_detail(cs_insn *ins)
|
||||
}
|
||||
|
||||
if (ppc->bc != 0)
|
||||
printf("\tBranch code: %u\n", ins->detail->ppc.bc);
|
||||
printf("\tBranch code: %u\n", ppc->bc);
|
||||
|
||||
if (ppc->bh != 0)
|
||||
printf("\tBranch hint: %u\n", ins->detail->ppc.bh);
|
||||
printf("\tBranch hint: %u\n", ppc->bh);
|
||||
|
||||
if (ppc->update_cr0)
|
||||
printf("\tUpdate-CR0: True\n");
|
||||
|
Loading…
Reference in New Issue
Block a user