简体   繁体   English

如何从$ 1重新命名GDB的内部变量?

[英]How to restart naming GDB's internal variables from $1?

By default, GDB's internal variables will be $1, $2, $3, .... How to restart naming them from $1? 默认情况下,GDB的内部变量将是$ 1,$ 2,$ 3,....如何从$ 1重新命名它们?

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

Looking at the documentation , there's no explicit command to clear the value history. 查看文档 ,没有明确的命令来清除值历史记录。

It does mention that the file and symbol-file commands, which can change the symbol table, clear the history. 它确实提到了可以更改符号表的filesymbol-file命令,可以清除历史记录。

Also, you can use output instead of print to avoid putting the printed value in the value history. 此外,您可以使用output而不是print来避免将打印值放入值历史记录中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM