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% 354> show convenience
$_undo_time_max = 355
$_undo_time_min = 1
$_undo_time = 354

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, forty BBs at a time, printing the value of the global variable g_transactions each time we jump backward.

99% 354> define print_every_forty
Type commands for definition of "print_every_forty".
End with a line saying just "end".
>while $_undo_time > 40
 >ugo time -40
 >p g_transactions
 >end
>end
99% 354> print_every_forty
[Switching to Thread 3746935.3746936]
0x00005555555552e1 in eater (p=0x0) at threads.c:54
54                      e = gettimeofday(&tv, NULL);
$1 = 3
malloc_init_state (av=0x7fffe8000030) at ./malloc/malloc.c:1949
1949    ./malloc/malloc.c: No such file or directory.
$2 = 2
malloc_init_state (av=0x7fffe8000030) at ./malloc/malloc.c:1949
1949    in ./malloc/malloc.c
$3 = 2
malloc_init_state (av=0x7fffe8000030) at ./malloc/malloc.c:1949
1949    in ./malloc/malloc.c
$4 = 2
0x00007ffff7e590f2 in _int_new_arena (size=640) at ./malloc/arena.c:638
638     ./malloc/arena.c: No such file or directory.
$5 = 2
0x0000555555555259 in eater (p=0x0) at threads.c:36
36              e = pthread_mutex_lock(&g_mutex);
$6 = 2
[Switching to Thread 3746935.3746937]
0x0000555555555553 in feeder (p=0x0) at threads.c:93
93              e = pthread_cond_signal(&g_condition);
$7 = 1
___pthread_mutex_unlock (mutex=0x5555555580e0 <g_mutex>) at ./nptl/pthread_mutex_unlock.c:368
368     ./nptl/pthread_mutex_unlock.c: No such file or directory.
$8 = 1