[qfcc] Improve debug printing of statements and operands

Makes it easier to check operand base indices and temporary variable
addresses when known.
This commit is contained in:
Bill Currie 2022-05-01 14:05:43 +09:00
parent ef9960c6f9
commit cdd8739577
2 changed files with 7 additions and 3 deletions

View file

@ -527,6 +527,9 @@ opcode_print_statement (pr_uint_t addr, dstatement_t *st)
} else {
mnemonic = pr_opcodes[st_op].mnemonic;
}
printf ("%04x (%03x)%-8s %04x %04x %04x\n",
addr, st_op & 0x1ff, mnemonic, st->a, st->b, st->c);
printf ("%04x (%03x)%-8s %d:%04x %d:%04x %d:%04x\n",
addr, st_op & 0x1ff, mnemonic,
(st->op & OP_A_BASE) >> OP_A_SHIFT, st->a,
(st->op & OP_B_BASE) >> OP_B_SHIFT, st->b,
(st->op & OP_C_BASE) >> OP_C_SHIFT, st->c);
}

View file

@ -162,7 +162,8 @@ _print_operand (operand_t *op)
case op_temp:
printf ("tmp (%s) %p", get_type_string (op->type), op);
if (op->tempop.def)
printf (" %s", op->tempop.def->name);
printf (" %s:%04x", op->tempop.def->name,
op->tempop.def->offset);
break;
case op_alias:
printf ("alias(%s,", get_type_string (op->type));