[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: |
Peter Maydell |
Subject: |
Re: [RFC PATCH 1/5] Rename the singlestep global variable to one_insn_per_tb |
Date: |
Fri, 10 Feb 2023 16:48:25 +0000 |
On Mon, 6 Feb 2023 at 20:20, Thomas Huth <thuth@redhat.com> 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 <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.
I agree in principle, but this might be tricky because of the
user-mode emulators. I'll have a look.
-- PMM
- [RFC PATCH 0/5] Deprecate/rename singlestep command line option, Peter Maydell, 2023/02/06
- [RFC PATCH 5/5] hmp: Add 'one-insn-per-tb' command equivalent to 'singlestep', Peter Maydell, 2023/02/06
- [RFC PATCH 2/5] linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep', Peter Maydell, 2023/02/06
- [RFC PATCH 3/5] bsd-user: Add '-one-insn-per-tb' option equivalent to '-singlestep', Peter Maydell, 2023/02/06
- [RFC PATCH 1/5] Rename the singlestep global variable to one_insn_per_tb, Peter Maydell, 2023/02/06
- [RFC PATCH 4/5] softmmu: Add '-one-insn-per-tb' option equivalent to '-singlestep', Peter Maydell, 2023/02/06
- Re: [RFC PATCH 0/5] Deprecate/rename singlestep command line option, Richard Henderson, 2023/02/06
- Re: [RFC PATCH 0/5] Deprecate/rename singlestep command line option, Thomas Huth, 2023/02/06
- Re: [RFC PATCH 0/5] Deprecate/rename singlestep command line option, Markus Armbruster, 2023/02/07