Pavel Dovgalyuk <pavel.dovgal...@ispras.ru> writes:
> From: Pavel Dovgalyuk <pavel.dovga...@ispras.ru> > > GDB remote protocol supports two reverse debugging commands: > reverse step and reverse continue. > This patch adds support of the first one to the gdbstub. > Reverse step is intended to step one instruction in the backwards > direction. This is not possible in regular execution. > But replayed execution is deterministic, therefore we can load one of > the prior snapshots and proceed to the desired step. It is equivalent > to stepping one instruction back. > There should be at least one snapshot preceding the debugged part of > the replay log. > > Signed-off-by: Pavel Dovgalyuk <pavel.dovgal...@ispras.ru> > --- > 0 files changed > > diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c > index 603d17ff83..fb1e19c585 100644 > --- a/accel/tcg/translator.c > +++ b/accel/tcg/translator.c > @@ -17,6 +17,7 @@ > #include "exec/log.h" > #include "exec/translator.h" > #include "exec/plugin-gen.h" > +#include "sysemu/replay.h" > > /* Pairs with tcg_clear_temp_count. > To be called by #TranslatorOps.{translate_insn,tb_stop} if > diff --git a/cpus.c b/cpus.c > index 41d1c5099f..35381ea941 100644 > --- a/cpus.c > +++ b/cpus.c > @@ -1100,9 +1100,17 @@ static bool cpu_can_run(CPUState *cpu) > > static void cpu_handle_guest_debug(CPUState *cpu) > { > - gdb_set_stop_cpu(cpu); > - qemu_system_debug_request(); > - cpu->stopped = true; > + if (!replay_running_debug()) { > + gdb_set_stop_cpu(cpu); > + qemu_system_debug_request(); > + cpu->stopped = true; > + } else { > + if (!cpu->singlestep_enabled) { > + cpu_single_step(cpu, SSTEP_ENABLE); > + } else { > + cpu_single_step(cpu, 0); > + } > + } This no longer applies cleanly. -- Alex Bennée