All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/1] M68k for 5.0 patches
@ 2020-01-21 12:21 Laurent Vivier
  2020-01-21 12:21 ` [PULL 1/1] m68k: Fix regression causing Single-Step via GDB/RSP to not single step Laurent Vivier
  2020-01-21 12:59 ` [PULL 0/1] M68k for 5.0 patches Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Laurent Vivier @ 2020-01-21 12:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier

The following changes since commit d83bbedab5a2758fbb7866c06472feb3f3bf079b:

  Makefile: add missing mkdir MANUAL_BUILDDIR (2020-01-21 11:56:17 +0000)

are available in the Git repository at:

  git://github.com/vivier/qemu-m68k.git tags/m68k-for-5.0-pull-request

for you to fetch changes up to 322f244aaa80a5208090d41481c1c09c6face66b:

  m68k: Fix regression causing Single-Step via GDB/RSP to not single step (2020-01-21 13:05:45 +0100)

----------------------------------------------------------------
Fix m68k single-stepping with remote gdb

----------------------------------------------------------------

Laurent Vivier (1):
  m68k: Fix regression causing Single-Step via GDB/RSP to not single
    step

 target/m68k/translate.c | 42 ++++++++++++++++++++++++++---------------
 1 file changed, 27 insertions(+), 15 deletions(-)

-- 
2.24.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PULL 1/1] m68k: Fix regression causing Single-Step via GDB/RSP to not single step
  2020-01-21 12:21 [PULL 0/1] M68k for 5.0 patches Laurent Vivier
@ 2020-01-21 12:21 ` Laurent Vivier
  2020-01-21 12:59 ` [PULL 0/1] M68k for 5.0 patches Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2020-01-21 12:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Lucien Murray-Pitts, Richard Henderson, Laurent Vivier

A regression that was introduced, with the refactor to TranslatorOps,
drops two lines that update the PC when single-stepping is being performed.

Fixes: 11ab74b01e0a ("target/m68k: Convert to TranslatorOps")
Reported-by: Lucien Murray-Pitts <lucienmp_antispam@yahoo.com>
Suggested-by: Lucien Murray-Pitts <lucienmp_antispam@yahoo.com>
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200116165454.2076265-1-laurent@vivier.eu>
---
 target/m68k/translate.c | 42 ++++++++++++++++++++++++++---------------
 1 file changed, 27 insertions(+), 15 deletions(-)

diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index 31b743717e..0f80888203 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -289,16 +289,21 @@ static void gen_jmp(DisasContext *s, TCGv dest)
     s->base.is_jmp = DISAS_JUMP;
 }
 
-static void gen_exception(DisasContext *s, uint32_t dest, int nr)
+static void gen_raise_exception(int nr)
 {
     TCGv_i32 tmp;
 
-    update_cc_op(s);
-    tcg_gen_movi_i32(QREG_PC, dest);
-
     tmp = tcg_const_i32(nr);
     gen_helper_raise_exception(cpu_env, tmp);
     tcg_temp_free_i32(tmp);
+}
+
+static void gen_exception(DisasContext *s, uint32_t dest, int nr)
+{
+    update_cc_op(s);
+    tcg_gen_movi_i32(QREG_PC, dest);
+
+    gen_raise_exception(nr);
 
     s->base.is_jmp = DISAS_NORETURN;
 }
@@ -6198,29 +6203,36 @@ static void m68k_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
 {
     DisasContext *dc = container_of(dcbase, DisasContext, base);
 
-    if (dc->base.is_jmp == DISAS_NORETURN) {
-        return;
-    }
-    if (dc->base.singlestep_enabled) {
-        gen_helper_raise_exception(cpu_env, tcg_const_i32(EXCP_DEBUG));
-        return;
-    }
-
     switch (dc->base.is_jmp) {
+    case DISAS_NORETURN:
+        break;
     case DISAS_TOO_MANY:
         update_cc_op(dc);
-        gen_jmp_tb(dc, 0, dc->pc);
+        if (dc->base.singlestep_enabled) {
+            tcg_gen_movi_i32(QREG_PC, dc->pc);
+            gen_raise_exception(EXCP_DEBUG);
+        } else {
+            gen_jmp_tb(dc, 0, dc->pc);
+        }
         break;
     case DISAS_JUMP:
         /* We updated CC_OP and PC in gen_jmp/gen_jmp_im.  */
-        tcg_gen_lookup_and_goto_ptr();
+        if (dc->base.singlestep_enabled) {
+            gen_raise_exception(EXCP_DEBUG);
+        } else {
+            tcg_gen_lookup_and_goto_ptr();
+        }
         break;
     case DISAS_EXIT:
         /*
          * We updated CC_OP and PC in gen_exit_tb, but also modified
          * other state that may require returning to the main loop.
          */
-        tcg_gen_exit_tb(NULL, 0);
+        if (dc->base.singlestep_enabled) {
+            gen_raise_exception(EXCP_DEBUG);
+        } else {
+            tcg_gen_exit_tb(NULL, 0);
+        }
         break;
     default:
         g_assert_not_reached();
-- 
2.24.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PULL 0/1] M68k for 5.0 patches
  2020-01-21 12:21 [PULL 0/1] M68k for 5.0 patches Laurent Vivier
  2020-01-21 12:21 ` [PULL 1/1] m68k: Fix regression causing Single-Step via GDB/RSP to not single step Laurent Vivier
@ 2020-01-21 12:59 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2020-01-21 12:59 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: QEMU Developers

On Tue, 21 Jan 2020 at 12:22, Laurent Vivier <laurent@vivier.eu> wrote:
>
> The following changes since commit d83bbedab5a2758fbb7866c06472feb3f3bf079b:
>
>   Makefile: add missing mkdir MANUAL_BUILDDIR (2020-01-21 11:56:17 +0000)
>
> are available in the Git repository at:
>
>   git://github.com/vivier/qemu-m68k.git tags/m68k-for-5.0-pull-request
>
> for you to fetch changes up to 322f244aaa80a5208090d41481c1c09c6face66b:
>
>   m68k: Fix regression causing Single-Step via GDB/RSP to not single step (2020-01-21 13:05:45 +0100)
>
> ----------------------------------------------------------------
> Fix m68k single-stepping with remote gdb
>
> ----------------------------------------------------------------
>
> Laurent Vivier (1):
>   m68k: Fix regression causing Single-Step via GDB/RSP to not single
>     step
>
>  target/m68k/translate.c | 42 ++++++++++++++++++++++++++---------------
>  1 file changed, 27 insertions(+), 15 deletions(-)


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.0
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-21 13:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21 12:21 [PULL 0/1] M68k for 5.0 patches Laurent Vivier
2020-01-21 12:21 ` [PULL 1/1] m68k: Fix regression causing Single-Step via GDB/RSP to not single step Laurent Vivier
2020-01-21 12:59 ` [PULL 0/1] M68k for 5.0 patches Peter Maydell

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.