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

frameupおよびコマンドを使用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).
于 2011-11-23T21:36:27.740 に答える