[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 14/15] replay: create temporary snapshot at debugger conne
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v5 14/15] replay: create temporary snapshot at debugger connection |
Date: |
Tue, 22 Sep 2020 14:55:42 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
Hi Pavel,
On 9/22/20 2:16 PM, Pavel Dovgalyuk wrote:
> When record/replay does not uses overlays for storing the snapshots,
> user is not capable of issuing reverse debugging commands.
> This patch adds creation of the VM snapshot on the temporary
> overlay image, when the debugger connects to QEMU.
> Therefore the execution can be rewind to the moment
> of the debugger connection while debugging the virtual machine.
>
> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
> ---
> gdbstub.c | 1 +
> include/sysemu/replay.h | 2 ++
> replay/replay-debugging.c | 16 ++++++++++++++++
> 3 files changed, 19 insertions(+)
>
> diff --git a/gdbstub.c b/gdbstub.c
> index ac92273018..f19f98ab1a 100644
> --- a/gdbstub.c
> +++ b/gdbstub.c
> @@ -3321,6 +3321,7 @@ static void gdb_chr_event(void *opaque, QEMUChrEvent
> event)
> s->g_cpu = s->c_cpu;
>
> vm_stop(RUN_STATE_PAUSED);
> + replay_gdb_attached();
> gdb_has_xml = false;
> break;
> default:
> diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
> index b6cac175c4..2aa34b8919 100644
> --- a/include/sysemu/replay.h
> +++ b/include/sysemu/replay.h
> @@ -94,6 +94,8 @@ bool replay_reverse_continue(void);
> bool replay_running_debug(void);
> /* Called in reverse debugging mode to collect breakpoint information */
> void replay_breakpoint(void);
> +/* Called when gdb is attached to gdbstub */
> +void replay_gdb_attached(void);
>
> /* Processing the instructions */
>
> diff --git a/replay/replay-debugging.c b/replay/replay-debugging.c
> index d02d4e0766..bb9110707a 100644
> --- a/replay/replay-debugging.c
> +++ b/replay/replay-debugging.c
> @@ -316,3 +316,19 @@ void replay_breakpoint(void)
> assert(replay_mode == REPLAY_MODE_PLAY);
> replay_last_breakpoint = replay_get_current_icount();
> }
> +
> +void replay_gdb_attached(void)
> +{
> + /*
> + * Create VM snapshot on temporary overlay to allow reverse
> + * debugging even if snapshots were not enabled.
> + */
> + if (replay_mode == REPLAY_MODE_PLAY
> + && !replay_snapshot) {
> + Error *err = NULL;
> + if (save_snapshot("start_debugging", &err) != 0) {
> + /* Can't create the snapshot. Continue conventional debugging. */
If you deliberately ignore the error, then use NULL;
else display the error.
> + error_free(err);
> + }
> + }
> +}
>
- [PATCH v5 06/15] replay: introduce info hmp/qmp command, (continued)
- [PATCH v5 06/15] replay: introduce info hmp/qmp command, Pavel Dovgalyuk, 2020/09/22
- [PATCH v5 07/15] replay: introduce breakpoint at the specified step, Pavel Dovgalyuk, 2020/09/22
- [PATCH v5 08/15] replay: implement replay-seek command, Pavel Dovgalyuk, 2020/09/22
- [PATCH v5 09/15] replay: flush rr queue before loading the vmstate, Pavel Dovgalyuk, 2020/09/22
- [PATCH v5 10/15] gdbstub: add reverse step support in replay mode, Pavel Dovgalyuk, 2020/09/22
- [PATCH v5 11/15] gdbstub: add reverse continue support in replay mode, Pavel Dovgalyuk, 2020/09/22
- [PATCH v5 12/15] replay: describe reverse debugging in docs/replay.txt, Pavel Dovgalyuk, 2020/09/22
- [PATCH v5 13/15] docs: convert replay.txt to rst, Pavel Dovgalyuk, 2020/09/22
- [PATCH v5 14/15] replay: create temporary snapshot at debugger connection, Pavel Dovgalyuk, 2020/09/22
- Re: [PATCH v5 14/15] replay: create temporary snapshot at debugger connection,
Philippe Mathieu-Daudé <=
- [PATCH v5 15/15] tests/acceptance: add reverse debugging test, Pavel Dovgalyuk, 2020/09/22
- Re: [PATCH v5 00/15] Reverse debugging, no-reply, 2020/09/22
- Re: [PATCH v5 00/15] Reverse debugging, no-reply, 2020/09/22