gdb:打印不在当前范围内的变量

use*_*276 5 gdb

我正在使用gdb,我想要打印当前不在范围内的变量.我不确定变量的确切名称是什么,所以我希望能够更改范围而不是在特定文件中打印特定变量.

Nei*_*eil 8

您可以使用frame,updown命令访问堆栈上的范围.

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).
Run Code Online (Sandbox Code Playgroud)