From: Eli Zaretskii <eliz@gnu.org>
To: gdb@sourceware.org
Subject: Expanding macros in breakpoint conditions
Date: Mon, 21 Oct 2013 16:53:00 -0000 [thread overview]
Message-ID: <83vc0qk1jx.fsf@gnu.org> (raw)
I was tripped by GDB today when I set a conditioned breakpoint, like
this:
(gdb) break foobar.c:1234 if FOO > 24.5
where FOO is a macro that expands to some_struct.foo. Then I ran the
program, and it didn't stop at the breakpoint, although the condition
surely held at some point, and that location is in a loop the program
goes through repeatedly, many times.
Then I did
(gdb) break foobar.c:1234 if some_struct.foo > 24.5
and re-ran the program. This time, it did stop. Moreover, GDB does
know about the macro, because right after it stop, I typed this:
(gdb) p FOO
$1 = 25.001
So my question is: is GDB supposed to expand macros in breakpoint
conditions?
This was with GDB 7.6.1 on Windows debugging a MinGW program compiled
with GCC 4.7.2.
TIA
next reply other threads:[~2013-10-21 16:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-21 16:53 Eli Zaretskii [this message]
2013-10-21 17:09 ` Tom Tromey
2013-10-23 17:04 ` Eli Zaretskii
2013-10-23 17:26 ` Tom Tromey
2013-10-23 17:33 ` Keith Seitz
2013-10-23 18:08 ` Eli Zaretskii
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=83vc0qk1jx.fsf@gnu.org \
--to=eliz@gnu.org \
--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