Values printed by the
When the symbol table changes, the value history is discarded,
since the values may contain pointers back to the types defined in the
The values printed are given history numbers by which you can
refer to them. These are successive integers starting with one.
$num = ’ before the value; here
num is the
To refer to any previous value, use ‘
$’ followed by the value’s
history number. The way
$ refers to the most recent value in
the history, and
$$ refers to the value before that.
$$n refers to the
nth value from the end;
is the value just prior to
$$1 is equivalent to
$$0 is equivalent to
For example, suppose you have just printed a pointer to a structure and want to see the contents of the structure. It suffices to type
If you have a chain of structures where the component
to the next one, you can print the contents of the next one with this:
You can print successive links in the chain by repeating this
command—which you can do by just typing
Note that the history records values, not expressions. If the value of
x is 4 and you type these commands:
print x set x=5
then the value recorded in the value history by the
x has changed.
Print the last ten values in the value history, with their item numbers.
This is like ‘
p $$9’ repeated ten times, except that
show values does not change the history.
show values n
Print ten history values centered on history item number
show values +
Print ten history values just after the values last printed. If no more
values are available,
show values + produces no display.
RET to repeat
show values n has exactly the
same effect as ‘
show values +’.