This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: preprocessor support?
>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:
Daniel> On Fri, May 28, 2004 at 03:24:19PM -0400, Paul Koning wrote:
>> These days GCC will output dwarf2 debug sections listing
>> preprocessor symbol definitions, but gdb 6.1 doesn't seem to look
>> at that (at least not for mips-netbsd).
>>
>> Is that not implemented yet? Is it in some targets but not this
>> one (and if so, any pointers to places I might look to teach this
>> target a new trick)?
Daniel> It should work everywhere, so you'll have to dig at it
Daniel> harder. I'm not sure that it's tested; there's at least one
Daniel> test in the testsuite but I don't see it going out of its way
Daniel> to pass -g3, so the binary won't have macro information.
To be more specific:
I looked at the .S file coming out of gcc, and saw the macro debug
data.
I then linked the executable file, did an objdump on that, and again
saw the macros in the debug data (.debug_macinfo section).
I then fed the executable to gdb, and asked it to print me the value
of a couple of preprocessor symbols, like TEST which I defined and
__GNUC__ which gcc put in. Gdb said:
No symbol "__GNUC__" in current context.
Do I need to speak a magic word to have gdb look for the macro
symbols?
paul