qemu-devel
[Top][All Lists]
Advanced

[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();
> +}
> +




reply via email to

[Prev in Thread] Current Thread [Next in Thread]