Skip to content

Commit

Permalink
target/avr/cpu: Fix $PC displayed address
Browse files Browse the repository at this point in the history
$PC is 16-bit wide. Other registers display addresses on a byte
granularity.
To have a coherent ouput, display $PC using byte granularity too.

Reviewed-by: Thomas Huth <huth@tuxfamily.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200707070021.10031-3-f4bug@amsat.org>
  • Loading branch information
philmd committed Jul 11, 2020
1 parent a291bc8 commit 2e34e62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target/avr/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static void avr_cpu_dump_state(CPUState *cs, FILE *f, int flags)
int i;

qemu_fprintf(f, "\n");
qemu_fprintf(f, "PC: %06x\n", env->pc_w);
qemu_fprintf(f, "PC: %06x\n", env->pc_w * 2); /* PC points to words */
qemu_fprintf(f, "SP: %04x\n", env->sp);
qemu_fprintf(f, "rampD: %02x\n", env->rampD >> 16);
qemu_fprintf(f, "rampX: %02x\n", env->rampX >> 16);
Expand Down

0 comments on commit 2e34e62

Please sign in to comment.