Commit 7f6b4be1 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

QEMU: fixed Thumb code disassembly with qdisas

This used to work in earlier versions, but target_disas changed its syntax in 2.5.0.
Useful for debugging io_trace on DIGIC 6 (with CONFIG_QEMU=y).

--HG--
branch : qemu
parent 58b1e47fa975
......@@ -49,7 +49,15 @@ unsigned int eos_handle_ml_helpers ( unsigned int parm, EOSState *s, unsigned in
case REG_DISAS_32 & 0xFF: /* disassemble address (32-bit, ARM or Thumb) */
fprintf(stderr, KGRN);
target_disas(stderr, CPU(arm_env_get_cpu(&s->cpu0->env)), value & ~1, 4, value & 1);
int size = 4;
if (value & 1) /* Thumb code */
{
/* Thumb instruction: wide if bits [15:11] of current halfword
* are 0b11101/0b11110/0b11111 (A6.1 in ARMv7-AR) */
uint32_t bits = eos_get_mem_h(s, value & ~1) >> 11;
size = (bits == 0b11101 || bits == 0b11110 || bits == 0b11111) ? 4 : 2;
}
target_disas(stderr, CPU(arm_env_get_cpu(&s->cpu0->env)), value, size, 0);
fprintf(stderr, KRESET);
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment