Loading and saving recordings

When suitably licensed, UDB can load and save LiveRecorder recordings.

Loading recordings

Load a recording using the uload command in UDB, or by specifying the filename on the UDB command line. This loads the execution history of the program loaded from the recording file, including any debug symbols, so that it is ready to be replayed. This also loads bookmarks created by the same user when previously replaying the recording.

Loading a recording from the command line

You can specify a LiveRecorder recording when starting UDB. When a recording is passed as the final command-line argument to udb it is automatically loaded. For example:

$ udb -q recording.undo

The debugged program is at the beginning of recorded history. Start debugging
from here or, to proceed towards the end, use:
    continue - to replay from the beginning
    ugo end  - to jump straight to the end of history

No more reverse-execution history.
start 1> continue
Continuing.

Program received signal SIGABRT, Aborted.
Have reached end of recorded history.

The recorded program has exited.
You can use UDB reverse commands to go backwards; see "help udb" for details.

__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
end 221,568> backtrace
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007fb5ed2d8535 in __GI_abort () at abort.c:79
#2  0x0000560be659a37a in main () at cache.c:85

Going to the end of execution history after loading

By default, UDB starts replaying the recording from the beginning of execution history, but when investigating a crash it is often more convenient to start at the end.

Use the udb --load-goto-end command-line option to start debugging the loaded recording from the end of execution history. This is significantly faster than loading the recording and issuing the ugo end command as separate steps. For example:

$ udb -q --load-goto-end recording.undo

No more reverse-execution history.
0x0000560be659a080 in _start ()

Performing "ugo end" to jump to the end of the recording. Press ^C to
interrupt this and go back to the start.

Have reached end of recorded history.
end 221,568> backtrace
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007fb5ed2d8535 in __GI_abort () at abort.c:79
#2  0x0000560be659a37a in main () at cache.c:85

This can be configured for all UDB sessions by setting UNDO_load_goto_end=true in the environment.

uload [-e|-goto-end] filename

Load a LiveRecorder recording.

The filename argument names the recording file.

For example:

$ udb -q
not running> uload recording.undo

The debugged program is at the beginning of recorded history. Start debugging
from here or, to proceed towards the end, use:
    continue - to replay from the beginning
    ugo end  - to jump straight to the end of history

No more reverse-execution history.
0x0000560be659a080 in _start ()
start 1 start> continue
Continuing.

Program received signal SIGABRT, Aborted.
Have reached end of recorded history.

The recorded program has exited.
You can use UDB reverse commands to go backwards; see "help udb" for details.

__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
-e, -goto-end

Jump to the end of execution history immediately after loading. This has the same effect as the ugo end command, but can be substantially faster.

$ udb -q
not running> uload -e recording.undo

No more reverse-execution history.
0x0000560be659a080 in _start ()

Imported 2 bookmarks from the previous session. Use "uinfo bookmarks" to list
them.


Performing "ugo end" to jump to the end of the recording. Press ^C to
interrupt this and go back to the start.

Have reached end of recorded history.

uinfo recording-version

The Undo version used to create the loaded LiveRecorder recording.

For example:

end 221,568 end> uinfo recording-version
6.4.0 (build 4386222f7037e28804f7274f1e6360952e5885b5)

Saving recordings

usave filename

Save execution history as a LiveRecorder recording.

The filename argument names the recording file.

The recording can be loaded into UDB using the uload command.

Replaying on a different CPU

Replaying a recording that was created on a different CPU requires that the replay CPU supports all the instructions used by the program when it was recorded. UDB refuses to load a recording if these requirements cannot be satisfied, although a warning may be shown instead when loading recordings made with older versions of LiveRecorder. The uinfo replayability command shows the CPU features required to replay the loaded recording.

uinfo replayability

The CPU features required to replay the loaded LiveRecorder recording.

The features are reported in the same style as they appear in the flags fields of /proc/cpuinfo. A feature is listed if the program executed an instruction requiring that feature when it was originally recorded. Any hardware which supports all of the listed features can be used to replay this recording.

For example:

end 221,568 end> uinfo replayability
The CPU features required to replay 'recording.undo' are: avx avx2 bmi1 lm sse
sse2 xsave.