我正在使用 gdb,并且想要打印当前不在范围内的变量。我不确定变量的确切名称是什么,所以我希望能够更改范围而不是在特定文件中打印特定变量。
最佳答案
您可以使用frame
、up
和down
命令访问堆栈上的范围。
frame N
f N
Select frame number N. (The current instruction is in frame 0.)
up [N]
Move N frames up the stack (away from frame 0).
down [N]
Move N frames down the stack (towards frame 0).
关于scope - gdb:打印不在当前范围内的变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8249227/