Differences between revisions 2 and 3
Revision 2 as of 2009-09-28 01:46:45
Size: 708
Editor: AS-40816
Comment:
Revision 3 as of 2009-09-28 02:02:48
Size: 2028
Editor: AS-40816
Comment: Add primary process record commands and descriptions
Deletions are marked like this. Additions are marked like this.
Line 18: Line 18:

== How it works ==

Process record and replay works by logging the execution of each machine instruction
in the child process (the program being debugged), together with each corresponding
change in machine state (the values of memory and registers). By successively "undoing"
each change in machine state, in reverse order, it is possible to revert the state of
the program to an arbitrary point earlier in the execution. Then, by "redoing" the
changes in the original order, the program state can be moved forward again.

== User commands ==

The following gdb commands are defined for process record / replay:

 * "target record" (or simply "record", for short)

Start process record/replay (ie. start recording the subsequent execution of the
child process). You must start debugging the program (with the "run" command)
before using this command to start recording. You can start recording at any
point after the child process has been started (eg. at a breakpoint).

 * "record stop"

Stop process record/replay (ie. cease recording the program execution), and
discard any existing execution log. The child process is '''not''' terminated,
and you may continue to debug it normally.

 * "record delete"

Discard the existing execution log, and begin recording a new log.


Process Record and Replay

Process record and replay is a gdb feature first appearing in the 7.0 release (September 2009).

For supported architectures and OS/ABIs, this feature allows the user to record the execution of a program being debugged by gdb, and then "play back" the recorded execution, deterministicly and repeatedly if desired.

Process record and replay also supports gdb's [ReverseDebugging | reverse debugging] commands, so that during replay it is possible to debug the program backward as well as forward.

Supported Targets

Process record and replay is currently supported for the following gdb targets:

  • i386-linux
  • amd64-linux

How it works

Process record and replay works by logging the execution of each machine instruction in the child process (the program being debugged), together with each corresponding change in machine state (the values of memory and registers). By successively "undoing" each change in machine state, in reverse order, it is possible to revert the state of the program to an arbitrary point earlier in the execution. Then, by "redoing" the changes in the original order, the program state can be moved forward again.

User commands

The following gdb commands are defined for process record / replay:

  • "target record" (or simply "record", for short)

Start process record/replay (ie. start recording the subsequent execution of the child process). You must start debugging the program (with the "run" command) before using this command to start recording. You can start recording at any point after the child process has been started (eg. at a breakpoint).

  • "record stop"

Stop process record/replay (ie. cease recording the program execution), and discard any existing execution log. The child process is not terminated, and you may continue to debug it normally.

  • "record delete"

Discard the existing execution log, and begin recording a new log.


CategoryHomepage

None: ProcessRecord (last edited 2013-06-17 17:33:39 by TomTromey)

All content (C) 2008 Free Software Foundation. For terms of use, redistribution, and modification, please see the WikiLicense page.