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

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% 257> 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% 257> print_every_forty
[Switching to Thread 82.83]
0x0000555555555180 in gettimeofday@plt ()
$1 = 3
malloc_init_state (av=0x7fffe8000030) at ./malloc/malloc.c:1949
1949          bin->fd = bin->bk = bin;
$2 = 2
malloc_init_state (av=0x7fffe8000030) at ./malloc/malloc.c:1949
1949          bin->fd = bin->bk = bin;
$3 = 2
malloc_init_state (av=0x7fffe8000030) at ./malloc/malloc.c:1949
1949          bin->fd = bin->bk = bin;
$4 = 2
0x00007ffff7e520cc in alloc_new_heap (size=135168, size@entry=2904, top_pad=top_pad@entry=131072,
    pagesize=pagesize@entry=4096, mmap_flags=mmap_flags@entry=0) at ./malloc/arena.c:414
414           p1 = (char *) MMAP (0, max_size << 1, PROT_NONE, mmap_flags);
$5 = 2
[Switching to Thread 82.84]
0x0000555555555532 in feeder (p=0x0) at threads.c:75
75              usleep(1 + (random() % 100 * 1000));
$6 = 1