]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
m68k: fix 'bkpt' instruction in softmmu mode
authorLaurent Vivier <laurent@vivier.eu>
Thu, 26 Jan 2023 12:52:34 +0000 (13:52 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Wed, 1 Feb 2023 09:18:21 +0000 (10:18 +0100)
In linux-user mode, 'bkpt' generates an EXP_DEBUG exception to allow
QEMU gdb server to intercept and manage the operation with an external
debugger.

In softmmu mode, the instruction must generate an illegal instruction
exception as it is on real hardware to be managed by the kernel.

Buglink: https://gitlab.com/qemu-project/qemu/-/issues/1462
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230126125234.3186042-1-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
target/m68k/translate.c

index 18418312b14b41585e9df0098d4aff0d3c0684df..31178c3b1d17d3ff19e7f71be85cef1224f74b34 100644 (file)
@@ -2774,7 +2774,11 @@ DISAS_INSN(swap)
 
 DISAS_INSN(bkpt)
 {
+#if defined(CONFIG_SOFTMMU)
+    gen_exception(s, s->base.pc_next, EXCP_ILLEGAL);
+#else
     gen_exception(s, s->base.pc_next, EXCP_DEBUG);
+#endif
 }
 
 DISAS_INSN(pea)