1 May 2012 22:36
-ggdb3 -gdwarf-4 but "info macro BLAH" still doesn't work?
Martin Olsson <mnemo <at> minimum.se>
2012-05-01 20:36:49 GMT
2012-05-01 20:36:49 GMT
Hello, In a small test app built with -g3 I can print values of macros inside gdb by doing "info macro MYMACRONAME", however in a larger application I cannot get it to work despite passing the same -g3 and using the same gdb command. Just to be sure, I tried turning off stuff like pre-compiled headers etc in the large app but I still can't get the macro values to print correctly. In the large app, what I see is: (gdb) info macro MYMACRONAME The symbol `MYMACRONAME' has no definition as a C/C++ preprocessor macro at ../../platforms/linux/src/main.cpp:263 In both cases gdb "info source" reports "Includes preprocessor macro info." and also "Compiled with DWARF 2 debugging format." For the large app readelf also reports the macro I'm testing as present (so I'm assuming the gcc end is doing the right thing): $ readelf -wm binary | grep MYMACRONAME DW_MACINFO_define - lineno : 12 macro : MYMACRONAME 4096 FWIW; I'm using ubuntu 12.04 LTS which means I got gcc 4:4.6.3-1ubuntu5 and gdb 7.4-2012.02-0ubuntu2. I've also tried building with "-ggdb3 -gdwarf-4" but I still can't get values of macros and oddly gdb then still reports "Compiled with DWARF 2 debugging format", which was a bit weird? Also if I do "info macros" then I get nothing printed at all.(Continue reading)
RSS Feed