[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 34/37] gdbstub: add reverse continue support in replay mode
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PULL 34/37] gdbstub: add reverse continue support in replay mode |
Date: |
Fri, 30 Oct 2020 16:15:09 +0100 |
Hi Pavel,
On Tue, Oct 6, 2020 at 9:41 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
>
> This patch adds support of the reverse continue operation for gdbstub.
> Reverse continue finds the last breakpoint that would happen in normal
> execution from the beginning to the current moment.
> Implementation of the reverse continue replays the execution twice:
> to find the breakpoints that were hit and to seek to the last breakpoint.
> Reverse continue loads the previous snapshot and tries to find the breakpoint
> since that moment. If there are no such breakpoints, it proceeds to
> the earlier snapshot, and so on. When no breakpoints or watchpoints were
> hit at all, execution stops at the beginning of the replay log.
>
> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
> Message-Id: <160174522930.12451.6994758004725016836.stgit@pasha-ThinkPad-X280>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> exec.c | 1 +
> gdbstub.c | 10 +++++-
> include/sysemu/replay.h | 8 +++++
> replay/replay-debugging.c | 72 +++++++++++++++++++++++++++++++++++++++
> softmmu/cpus.c | 5 +++
> stubs/replay.c | 5 +++
> 6 files changed, 100 insertions(+), 1 deletion(-)
...
> +static void replay_continue_stop(void *opaque)
> +{
> + Error *err = NULL;
> + if (replay_last_breakpoint != -1LL) {
> + replay_seek(replay_last_breakpoint, replay_stop_vm_debug, &err);
> + if (err) {
> + error_free(err);
> + replay_continue_end();
> + }
> + return;
> + }
> + /*
> + * No breakpoints since the last snapshot.
> + * Find previous snapshot and try again.
> + */
> + if (replay_last_snapshot != 0) {
> + replay_seek(replay_last_snapshot - 1, replay_continue_stop, &err);
> + if (err) {
> + error_free(err);
> + replay_continue_end();
> + }
> + replay_last_snapshot = replay_get_current_icount();
> + return;
> + } else {
> + /* Seek to the very first step */
> + replay_seek(0, replay_stop_vm_debug, &err);
> + if (err) {
> + error_free(err);
> + replay_continue_end();
> + }
> + return;
> + }
Coverity (CID 1433220) reports this is dead code:
> + replay_continue_end();
> +}
> +
- [PULL 27/37] migration: introduce icount field for snapshots, (continued)
- [PULL 27/37] migration: introduce icount field for snapshots, Paolo Bonzini, 2020/10/06
- [PULL 28/37] qapi: introduce replay.json for record/replay-related stuff, Paolo Bonzini, 2020/10/06
- [PULL 29/37] replay: introduce info hmp/qmp command, Paolo Bonzini, 2020/10/06
- [PULL 30/37] replay: introduce breakpoint at the specified step, Paolo Bonzini, 2020/10/06
- [PULL 35/37] replay: describe reverse debugging in docs/replay.txt, Paolo Bonzini, 2020/10/06
- [PULL 32/37] replay: flush rr queue before loading the vmstate, Paolo Bonzini, 2020/10/06
- [PULL 31/37] replay: implement replay-seek command, Paolo Bonzini, 2020/10/06
- [PULL 33/37] gdbstub: add reverse step support in replay mode, Paolo Bonzini, 2020/10/06
- [PULL 34/37] gdbstub: add reverse continue support in replay mode, Paolo Bonzini, 2020/10/06
- Re: [PULL 34/37] gdbstub: add reverse continue support in replay mode,
Philippe Mathieu-Daudé <=
- [PULL 36/37] replay: create temporary snapshot at debugger connection, Paolo Bonzini, 2020/10/06
- [PULL 37/37] tests/acceptance: add reverse debugging test, Paolo Bonzini, 2020/10/06
- Re: [PULL 00/37] Build system + accel + record/replay patches for 2020-10-06, Peter Maydell, 2020/10/06