qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 1/5] Rename the singlestep global variable to one_insn_pe


From: Thomas Huth
Subject: Re: [RFC PATCH 1/5] Rename the singlestep global variable to one_insn_per_tb
Date: Mon, 6 Feb 2023 21:20:43 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

On 06/02/2023 18.13, Peter Maydell wrote:
The 'singlestep' global variable is badly misnamed, because it has
nothing to do with single-stepping the emulation either via the gdb
stub or by emulation of architectural debug facilities.  Instead what
it does is force TCG to put only one instruction into each TB.
Rename it to one_insn_per_tb, so that it reflects what it does better
and is easier to search for in the codebase.

This misnaming is also present in user-facing interfaces: the command
line option '-singlestep', the HMP 'singlestep' command, and the QMP
StatusInfo object.  Those are harder to update because we need to
retain backwards compatibility.  Subsequent patches will add
better-named aliases so we can eventually deprecate-and-drop the old,
bad name.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
  include/exec/cpu-common.h   | 2 +-
  accel/tcg/cpu-exec.c        | 4 ++--
  bsd-user/main.c             | 4 ++--
  linux-user/main.c           | 4 ++--
  softmmu/globals.c           | 2 +-
  softmmu/runstate-hmp-cmds.c | 4 ++--
  softmmu/runstate.c          | 2 +-
  softmmu/vl.c                | 2 +-
  8 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 6feaa40ca7b..f2592a1967f 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -163,7 +163,7 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr,
                          void *ptr, size_t len, bool is_write);
/* vl.c */
-extern int singlestep;
+extern int one_insn_per_tb;

IMHO the global variable should completely go away - this should get a property of the tcg accel instead.

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]