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

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

问题描述

如何打印所有全局变量/局部变量?这在 gdb 中可能吗?

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

推荐答案

Type info variables 列出所有全局和静态变量名称".

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

输入 info locals 列出当前堆栈帧的局部变量"(名称和值),包括该函数中的静态变量.

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

输入信息参数 列出当前堆栈帧的参数"(名称和值).

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

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

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