【问题标题】:gdb: printing a variable not in the current scopegdb:打印不在当前范围内的变量
【发布时间】:2012-01-05 03:51:06
【问题描述】:

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

【问题讨论】:

    标签: scope gdb local-variables callstack


    【解决方案1】:

    您可以使用frameupdown 命令访问堆栈上的范围。

    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).
    

    【讨论】:

      猜你喜欢
      • 2016-06-23
      • 1970-01-01
      • 1970-01-01
      • 2011-07-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-12
      相关资源
      最近更新 更多