How to restart naming GDB internal variables with $ 1?

By default, GDB's internal variables will be $ 1, $ 2, $ 3, .... How do I overwrite their names from $ 1?

(gdb) p v1
$1 = 7
(gdb) p v2
$2 = 8
(gdb) p v3
$3 = 9
(gdb) ??? // what should be put here?
$1 = 0

      

+3


source to share


1 answer


Looking at the documentation , there is no explicit command to clear the value history.

It mentions commands file

and symbol-file

that can change the symbol table, clear history.



Alternatively, you can use output

instead print

to avoid putting the printed value in the value history.

+4


source







All Articles