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

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% 347> 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% 347> print_every_forty
malloc_init_state (av=0x7fffe8000030) at ./malloc/malloc.c:1963
1963    in ./malloc/malloc.c
$1 = 3
malloc_init_state (av=0x7fffe8000030) at ./malloc/malloc.c:1963
1963    in ./malloc/malloc.c
$2 = 3
malloc_init_state (av=0x7fffe8000030) at ./malloc/malloc.c:1963
1963    in ./malloc/malloc.c
$3 = 3
_dl_runtime_resolve_xsavec () at ../sysdeps/x86_64/dl-trampoline.h:131
131     ../sysdeps/x86_64/dl-trampoline.h: No such file or directory.
$4 = 3
[Switching to Thread 2414619.2414621]
__random () at ./stdlib/random.c:288
288     ./stdlib/random.c: No such file or directory.
$5 = 3
__GI___pthread_disable_asynccancel (oldtype=0) at ./nptl/cancellation.c:66
66      ./nptl/cancellation.c: No such file or directory.
$6 = 2
0x00007ffff7fdafae in _dl_fixup (l=0x7ffff7ffe2e0, reloc_arg=5) at ./elf/dl-runtime.c:95
95      ./elf/dl-runtime.c: No such file or directory.
$7 = 1
0x00007ffff7fd3d1b in check_match (
    undef_name=undef_name@entry=0x5555555546b2 "pthread_mutex_unlock",
    ref=ref@entry=0x5555555544d0, version=version@entry=0x7ffff7fc36f0, flags=flags@entry=5,
    type_class=type_class@entry=1, sym=0x7ffff7de1d30, symidx=2591, strtab=0x7ffff7de4790 "",
    map=0x7ffff7fc3160, versioned_sym=0x7ffff75c4938, num_versions=0x7ffff75c4934)
    at ./elf/dl-lookup.c:79
79      ./elf/dl-lookup.c: No such file or directory.
$8 = 1