Cha*_* Ma 46 c gdb c-preprocessor
根据主题.
我有一些常量哈希定义如下:
#define CONST 40
Run Code Online (Sandbox Code Playgroud)
我在我的程序中设置了一个断点.如何打印该常量的值?(我知道我可以查看源代码,但我想确定它)
小智 48
help macro
Run Code Online (Sandbox Code Playgroud)
您必须使用-g3标志进行编译才能使其工作并在加载宏之前启动程序.
在你的情况下:
info macro CONST
Run Code Online (Sandbox Code Playgroud)
要么
macro expand CONST
Run Code Online (Sandbox Code Playgroud)
更多信息:http://sourceware.org/gdb/current/onlinedocs/gdb/Macros.html