From: Luke <hazelnusse@gmail.com>
To: gdb@sourceware.org
Subject: Re: -ggdb3 -gdwarf-4 but "info macro BLAH" still doesn't work?
Date: Tue, 08 May 2012 10:04:00 -0000 [thread overview]
Message-ID: <CAEQ-UNe4TOemQ0u7k90GrddERceEbiW1juTckkgVCc79W0zdXA@mail.gmail.com> (raw)
I'm having the same problem.
Here is a very simple test C program:
#include <stdio.h>
#define M 42
#define ADD(x) (M + x)
int main ()
{
printf("%d\n", M);
printf("%d\n", ADD(2));
return 0;
}
I compile with:
$ gcc -gdwarf-4 -gdb3 -Wall -O0 sample.c -o sample
then debug:
$ gdb -q ./sample
Reading symbols from /tmp/sample...done.
(gdb) b main
Breakpoint 1 at 0x400560: file sample.c, line 6.
(gdb) run
Starting program: /tmp/sample
Breakpoint 1, main () at sample.c:6
6 printf("%d\n", M);
(gdb) macro list
(gdb) info source
Current source file is sample.c
Compilation directory is /tmp
Located in /tmp/sample.c
Contains 27 lines.
Source language is c.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info.
(gdb) macro expand ADD(1)
expands to: ADD(1)
(gdb) print M
No symbol "M" in current context.
I have tried -g3, -gstabs, -gstabs+ and all have the same problem.
This happens with Linaro gcc 4.7-2012.04, as well as a very recent
pull from gcc master (4.8.0 20120502).
It doesn't happen with gcc 4.6.2.
Hopefully somebody is aware of this and knows what to do.
Any suggestions? I'm guessing this is a gcc bug. I'll search there
and if it isn't already reported, I will reported it.
~Luke
next reply other threads:[~2012-05-08 10:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-08 10:04 Luke [this message]
2012-05-08 10:52 ` Jan Kratochvil
2012-05-08 10:55 ` Jan Kratochvil
-- strict thread matches above, loose matches on Subject: below --
2012-05-01 20:37 Martin Olsson
2012-05-01 21:56 ` Matt Rice
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=CAEQ-UNe4TOemQ0u7k90GrddERceEbiW1juTckkgVCc79W0zdXA@mail.gmail.com \
--to=hazelnusse@gmail.com \
--cc=gdb@sourceware.org \
/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