On Mon, 6 Feb 2023 at 20:20, Thomas Huth <[email protected]> wrote: > > 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 <[email protected]> > > --- > > 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.
I agree in principle, but this might be tricky because of the user-mode emulators. I'll have a look. -- PMM
