This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Expanding macros in breakpoint conditions
- From: Eli Zaretskii <eliz at gnu dot org>
- To: gdb at sourceware dot org
- Date: Mon, 21 Oct 2013 19:53:54 +0300
- Subject: Expanding macros in breakpoint conditions
- Authentication-results: sourceware.org; auth=none
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
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