The clone snapshot Command

Use the clone snapshot command to revert the state of the debuggee process to that of a previously saved snapshot. By doing this, you can conveniently return to the state saved in the snapshot as opposed to rerunning the process and re-entering the debugger command sequence that brought you to that state.

Note that rerun and clone snapshot are different in that rerun always executes the process from the beginning, whereas clone snapshot does not execute the process at all; it simply duplicates the saved snapshot (using a mechanism similar to the fork system call) and behaves as though the process execution has stopped at the point when the snapshot was saved.

The clone snapshot command clones the snapshot specified by snapshot_id. If no snapshot_id is specified, the most-recently saved existing snapshot is cloned.

 

clone_snapshot_command

        : clone snapshot  [ snapshot_id ]

snapshot_id

        : expression

 

Cloning a snapshot has two side effects:

(idb) show process

>localhost:29013 (/home/user/examples/x_list) paused.

(idb) clone snapshot

Process has exited

Process 29089 cloned from Snapshot 1.

# 1 saved at 13:27:54 (PID: 29077).

    stopped at [int main(void):182 0x1200023f8]

    182     List<Node> nodeList;

(idb) show process

>localhost:29089 (/home/user/examples/x_list) paused.