diff mbox series

[3/3] replay: fix for loading non-replay snapshots

Message ID 20230929085121.848482-4-pavel.dovgalyuk@ispras.ru
State New
Headers show
Series Record/replay patches | expand

Commit Message

Pavel Dovgalyuk Sept. 29, 2023, 8:51 a.m. UTC
From: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>

Snapshots created in regular icount execution mode can't be loaded
in recording mode, because icount value advances only by 32-bit value.
This patch initializes replay icount initial value after loading
the snapshot.

Cc: Pizarro Solar Rafael Ulises Luzius <rafael.pizarrosolar@epfl.ch>
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
---
 replay/replay-snapshot.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/replay/replay-snapshot.c b/replay/replay-snapshot.c
index 10a7cf7992..1e32ada1f6 100644
--- a/replay/replay-snapshot.c
+++ b/replay/replay-snapshot.c
@@ -75,6 +75,7 @@  void replay_vmstate_init(void)
 
     if (replay_snapshot) {
         if (replay_mode == REPLAY_MODE_RECORD) {
+            replay_state.current_icount = replay_get_current_icount();
             if (!save_snapshot(replay_snapshot,
                                true, NULL, false, NULL, &err)) {
                 error_report_err(err);