打印所有的全局变量/局部变量? [英] Printing all global variables/local variables?

查看:139
本文介绍了打印所有的全局变量/局部变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何打印所有的全局变量/局部变量?这有可能在GDB?

How can I print all global variables/local variables? Is that possible in gdb?

推荐答案

键入<一个href=\"http://sourceware.org/gdb/current/onlinedocs/gdb/Symbols.html#index-info-variables-918\"><$c$c>info变量 列出所有的全局和静态变量名称。

Type info variables to list "All global and static variable names".

键入<一个href=\"http://sourceware.org/gdb/current/onlinedocs/gdb/Frame-Info.html#index-info-locals-435\"><$c$c>info当地人 列出本地当前堆栈帧的变量(名称和值),包括该功能的静态变量。

Type info locals to list "Local variables of current stack frame" (names and values), including static variables in that function.

信息ARGS 列出当前堆栈帧的参数(名称和值)。

Type info args to list "Arguments of the current stack frame" (names and values).

这篇关于打印所有的全局变量/局部变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆