我正在使用gdb,想要打印当前未在作用域内的变量。由于不确定该变量的确切名称,因此希望能够更改作用域,而不是在特定文件中打印特定变量。
我正在使用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).