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

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% 248> 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% 248> print_every_thirty
0x00007ffff7e7d26f in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=req@entry=0x7ffff759aea0, rem=rem@entry=0x0) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
78      ../sysdeps/unix/sysv/linux/clock_nanosleep.c: No such file or directory.
$1 = 3
[Switching to Thread 608522.608523]
arena_get2 (size=size@entry=640, avoid_arena=avoid_arena@entry=0x0) at arena.c:919
919     arena.c: No such file or directory.
$2 = 2
malloc_init_state (av=0x7fffe8000020) at malloc.c:1798
1798    malloc.c: No such file or directory.
$3 = 2
malloc_init_state (av=0x7fffe8000020) at malloc.c:1798
1798    in malloc.c
$4 = 2
malloc_init_state (av=0x7fffe8000020) at malloc.c:1798
1798    in malloc.c
$5 = 2
malloc_init_state (av=0x7fffe8000020) at malloc.c:1798
1798    in malloc.c
$6 = 2
eater (p=0x0) at threads.c:36
36              e = pthread_mutex_lock(&g_mutex);
$7 = 2
[Switching to Thread 608522.608524]
__pthread_cond_signal (cond=0x5555555580a0 <g_condition>) at pthread_cond_signal.c:36
36      pthread_cond_signal.c: No such file or directory.
$8 = 1