All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: qemu-devel@nongnu.org, laurent@vivier.eu
Subject: [PATCH 2/4] target/m68k: call gen_raise_exception() directly if single-stepping in gen_jmp_tb()
Date: Wed, 19 May 2021 15:29:15 +0100	[thread overview]
Message-ID: <20210519142917.16693-3-mark.cave-ayland@ilande.co.uk> (raw)
In-Reply-To: <20210519142917.16693-1-mark.cave-ayland@ilande.co.uk>

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(-)

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);
-- 
2.20.1



  parent reply	other threads:[~2021-05-19 14:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 14:29 [PATCH 0/4] target/m68k: implement m68k "any instruction" trace mode Mark Cave-Ayland
2021-05-19 14:29 ` [PATCH 1/4] target/m68k: introduce is_singlestepping() function Mark Cave-Ayland
2021-05-21 13:51   ` Richard Henderson
2021-05-19 14:29 ` Mark Cave-Ayland [this message]
2021-05-21 13:52   ` [PATCH 2/4] target/m68k: call gen_raise_exception() directly if single-stepping in gen_jmp_tb() Richard Henderson
2021-05-19 14:29 ` [PATCH 3/4] target/m68k: introduce gen_singlestep_exception() function Mark Cave-Ayland
2021-05-21 13:52   ` Richard Henderson
2021-05-19 14:29 ` [PATCH 4/4] target/m68k: implement m68k "any instruction" trace mode Mark Cave-Ayland
2021-05-21 13:56   ` Richard Henderson
2021-05-26 18:46 ` [PATCH 0/4] " Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210519142917.16693-3-mark.cave-ayland@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.