This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Expanding macros in breakpoint conditions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]