From: Matt Rice <ratmice@gmail.com>
To: Martin Olsson <mnemo@minimum.se>
Cc: gdb@sourceware.org
Subject: Re: -ggdb3 -gdwarf-4 but "info macro BLAH" still doesn't work?
Date: Tue, 01 May 2012 21:56:00 -0000 [thread overview]
Message-ID: <CACTLOFoPu0KX7WJ-i-sy5GrgvbMCaFfyP3_VcFuqh7S4i0dYkg@mail.gmail.com> (raw)
In-Reply-To: <4FA04961.7020404@minimum.se>
On Tue, May 1, 2012 at 1:36 PM, Martin Olsson <mnemo@minimum.se> wrote:
> 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
the important part here I think is the:
at ../../platforms/linux/src/main.cpp:263
are you sure that MYMACRONAME is included and defined
at that point in the main.o file? info macro only does macros for the
place the program is currently executing at.
i see you are not getting the error message from the function
macro_inform_no_debuginfo so it seems there is a 'macro scope'.
> 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.
that is rather odd, even in empty sources i've always noticed some gcc
defined stuff from "info macros".
> What else can I try to make progress on this issue?
>
> If there is no easier way, maybe someone can recommend a breakpoint location
> in GDB where I can step through the code that executes the "info macro BLAH"
> command ?
macrocmd.c the function info_macro_command would probably be the place to start.
you can also try running make check and checking the results for the
macro tests,
macscp.exp
info-macros.exp
next prev parent reply other threads:[~2012-05-01 21:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-01 20:37 Martin Olsson
2012-05-01 21:56 ` Matt Rice [this message]
2012-05-08 10:04 Luke
2012-05-08 10:52 ` Jan Kratochvil
2012-05-08 10:55 ` Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACTLOFoPu0KX7WJ-i-sy5GrgvbMCaFfyP3_VcFuqh7S4i0dYkg@mail.gmail.com \
--to=ratmice@gmail.com \
--cc=gdb@sourceware.org \
--cc=mnemo@minimum.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox