7

I am using gdb and I was wanting to print a variable not currently in the scope. I am not sure what the exact name of the variable is so I would like to be able to change scopes rather than printing a specific variable in a specific file.

4

1 回答 1

10

您可以使用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).
于 2011-11-23T21:36:27.740 回答