Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Expanding macros in breakpoint conditions
@ 2013-10-21 16:53 Eli Zaretskii
  2013-10-21 17:09 ` Tom Tromey
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2013-10-21 16:53 UTC (permalink / raw)
  To: gdb

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-10-23 18:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-21 16:53 Expanding macros in breakpoint conditions Eli Zaretskii
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox