Convenience variables

UDB provides a number of convenience variables to allow for easier scripting. All of these variables have names starting _undo_.

The built-in command show convenience lists the convenience variables. For example:

99% 143> show convenience
$_undo_time_max = 144
$_undo_time_min = 1
$_undo_time = 143

Available variables

$_undo_time

The current bbcount.

$_undo_time_min

The bbcount of the earliest time in execution history. This value can never get smaller, but it can get larger when event log rotation occurs and old history is discarded to make space.

$_undo_time_max

The bbcount of the latest time in execution history. that represents the end of time. Like $_undo_time_min, this value can never get smaller. Unlike $_undo_time_min, this variable only gets larger when the program is in record mode.

Example usage

The following example shows how to jump through execution history, thirty BBs at a time, printing the value of the global variable g_transactions each time we jump backward.

99% 143> define print_every_thirty
Type commands for definition of "print_every_thirty".
End with a line saying just "end".
>while $_undo_time > 30
 >ugo time -30
 >p g_transactions
 >end
>end
99% 143> print_every_thirty
[Switching to Thread 26367.26368]
0x00005555555549a0 in pthread_cond_timedwait@plt ()
$1 = 3
malloc_init_state (av=0x7fffe8000020) at malloc.c:1816
1816    malloc.c: No such file or directory.
$2 = 2
new_heap (size=135168, size@entry=2824, top_pad=<optimised out>) at arena.c:514
514     arena.c: No such file or directory.
$3 = 2
0x00007ffff7bc2065 in futex_abstimed_wait_cancelable (private=<optimised out>, abstime=0x7ffff77c1ec0, expected=0, futex_word=0x5555557560c8 <g_condition+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
205     ../sysdeps/unix/sysv/linux/futex-internal.h: No such file or directory.
$4 = 1