gdb调试宏定义

直接上命令:

gcc -gdwarf-2 -g3 xxx.c

 

怎么得到的呢?

man gcc

找到 -glevel

   Level 3 includes extra information, such as all the macro definitions present in the program.  Some debuggers support macro expansion when you use -g3.

   -gdwarf-2 does not accept a concatenated debug level, because GCC used to support an option -gdwarf that meant to generate debug information in version 1 of the DWARF format

(which is very different from version 2), and it would have been too confusing. That debug format is long obsolete, but the option cannot be changed now. Instead use an additional -glevel option to change the debug level for
DWARF.

 

posted @ 2014-04-09 17:22  克莱尔孙  阅读(1053)  评论(0编辑  收藏  举报