Expanding macros in breakpoint conditions
Eli Zaretskii <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
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