mirror of https://github.com/inolen/redream.git
synchronize disassembly formats
This commit is contained in:
parent
427e5d64f7
commit
6b77942ee4
|
@ -513,10 +513,12 @@ static void x64_backend_dump_code(struct jit_backend *base, const uint8_t *addr,
|
|||
fprintf(output, "# x64\n");
|
||||
fprintf(output, "#==--------------------------------------------------==#\n");
|
||||
|
||||
const int max_mnemonic_width = 8;
|
||||
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
cs_insn &insn = insns[i];
|
||||
fprintf(output, "# 0x%" PRIx64 ":\t%s\t\t%s\n", insn.address, insn.mnemonic,
|
||||
insn.op_str);
|
||||
fprintf(output, "# 0x%08" PRIx64 " %-*s %s\n", insn.address,
|
||||
max_mnemonic_width, insn.mnemonic, insn.op_str);
|
||||
}
|
||||
|
||||
cs_free(insns, count);
|
||||
|
|
|
@ -138,7 +138,7 @@ void armv3_format(uint32_t addr, uint32_t instr, char *buffer,
|
|||
size_t value_len;
|
||||
|
||||
/* copy initial formatted description */
|
||||
snprintf(buffer, buffer_size, "%4x: %08x %s", addr, i.raw, def->desc);
|
||||
snprintf(buffer, buffer_size, "0x%08x %s", addr, def->desc);
|
||||
|
||||
/* cond */
|
||||
int cond = i.raw >> 28;
|
||||
|
|
|
@ -62,7 +62,7 @@ void sh4_format(uint32_t addr, union sh4_instr i, char *buffer,
|
|||
struct jit_opdef *def = sh4_get_opdef(i.raw);
|
||||
|
||||
if (def->flags & SH4_FLAG_INVALID) {
|
||||
snprintf(buffer, buffer_size, "%08x .word 0x%04x", addr, i.raw);
|
||||
snprintf(buffer, buffer_size, "0x%08x .word 0x%04x", addr, i.raw);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ void sh4_format(uint32_t addr, union sh4_instr i, char *buffer,
|
|||
uint32_t pcmask;
|
||||
|
||||
/* copy initial formatted description */
|
||||
snprintf(buffer, buffer_size, "%08x %s", addr, def->desc);
|
||||
snprintf(buffer, buffer_size, "0x%08x %s", addr, def->desc);
|
||||
|
||||
/* used by mov operators with displacements */
|
||||
if (strnstr(buffer, ".b", buffer_size)) {
|
||||
|
|
Loading…
Reference in New Issue