78 Chapter 10. Examining DataNote that the history records values, not expressions. If the value of x is 4 and you type these com-mands:print xset x=5then the value recorded in the value history by the print command remains 4 even though the valueof x has changed.show valuesPrint the last ten values in the value history, with their item numbers. This is like p $$9 repeatedten times, except that show values does not change the history.show values nPrint ten history values centered on history item number n.show values +Print ten history values just after the values last printed. If no more values are available, showvalues + produces no display.Pressing [RET] to repeat show values n has exactly the same effect as show values +.10.9. Convenience variablesgdb provides convenience variables that you can use within gdb to hold on to a value and refer toit later. These variables exist entirely within gdb; they are not part of your program, and setting aconvenience variable has no direct effect on further execution of your program. That is why you canuse them freely.Convenience variables are prefixed with $. Any name preceded by $ can be used for a conveniencevariable, unless it is one of the predefined machine-specific register names (refer to Section 10.10Registers). (Value history references, in contrast, are numbers preceded by $. Refer to Section 10.8Value history.)You can save a value in a convenience variable with an assignment expression, just as you would seta variable in your program. For example:set $foo = *object_ptrwould save in $foo the value contained in the object pointed to by object_ptr.Using a convenience variable for the first time creates it, but its value is void until you assign a newvalue. You can alter the value with another assignment at any time.Convenience variables have no fixed types. You can assign a convenience variable any type of value,including structures and arrays, even if that variable already has a value of a different type. Theconvenience variable, when used as an expression, has the type of its current value.