From fda8458bd3a9cb3108ba2f09921b6e3eee0d1bf3 Mon Sep 17 00:00:00 2001 From: Pavel Dovgalyuk Date: Sat, 3 Oct 2020 20:13:43 +0300 Subject: gdbstub: add reverse step support in replay mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Alex Bennée -- v4 changes: - inverted condition in cpu_handle_guest_debug (suggested by Alex Bennée) Message-Id: <160174522341.12451.1498758422543765253.stgit@pasha-ThinkPad-X280> Signed-off-by: Paolo Bonzini --- include/sysemu/replay.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/sysemu/replay.h') diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h index c486c3afb2..90bbb5d825 100644 --- a/include/sysemu/replay.h +++ b/include/sysemu/replay.h @@ -75,6 +75,17 @@ void replay_finish(void); void replay_add_blocker(Error *reason); /* Returns name of the replay log file */ const char *replay_get_filename(void); +/* + * Start making one step in backward direction. + * Used by gdbstub for backwards debugging. + * Returns true on success. + */ +bool replay_reverse_step(void); +/* + * Returns true if replay module is processing + * reverse_continue or reverse_step request + */ +bool replay_running_debug(void); /* Processing the instructions */ -- cgit v1.2.3