diff mbox series

[2/4] target/m68k: call gen_raise_exception() directly if single-stepping in gen_jmp_tb()

Message ID 20210519142917.16693-3-mark.cave-ayland@ilande.co.uk
State New
Headers show
Series target/m68k: implement m68k "any instruction" trace mode | expand

Commit Message

Mark Cave-Ayland May 19, 2021, 2:29 p.m. UTC
In order to consolidate the single-step exception handling into a single
helper, change gen_jmp_tb() so that it calls gen_raise_exception() directly
instead of gen_exception(). This ensures that all single-step exceptions are
now handled directly by gen_raise_exception().

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 target/m68k/translate.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Richard Henderson May 21, 2021, 1:52 p.m. UTC | #1
On 5/19/21 9:29 AM, Mark Cave-Ayland wrote:
> In order to consolidate the single-step exception handling into a single
> helper, change gen_jmp_tb() so that it calls gen_raise_exception() directly
> instead of gen_exception(). This ensures that all single-step exceptions are
> now handled directly by gen_raise_exception().
> 
> Signed-off-by: Mark Cave-Ayland<mark.cave-ayland@ilande.co.uk>
> ---
>   target/m68k/translate.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index c774f2e8f0..f14ecab5a5 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -1518,7 +1518,9 @@  static inline bool use_goto_tb(DisasContext *s, uint32_t dest)
 static void gen_jmp_tb(DisasContext *s, int n, uint32_t dest)
 {
     if (unlikely(is_singlestepping(s))) {
-        gen_exception(s, dest, EXCP_DEBUG);
+        update_cc_op(s);
+        tcg_gen_movi_i32(QREG_PC, dest);
+        gen_raise_exception(EXCP_DEBUG);
     } else if (use_goto_tb(s, dest)) {
         tcg_gen_goto_tb(n);
         tcg_gen_movi_i32(QREG_PC, dest);