From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28462 invoked by alias); 21 Oct 2013 16:53:48 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 28451 invoked by uid 89); 21 Oct 2013 16:53:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout23.012.net.il Received: from mtaout23.012.net.il (HELO mtaout23.012.net.il) (80.179.55.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 Oct 2013 16:53:46 +0000 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MV100M002NRNH00@a-mtaout23.012.net.il> for gdb@sourceware.org; Mon, 21 Oct 2013 19:53:44 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MV100MDI2XHM540@a-mtaout23.012.net.il> for gdb@sourceware.org; Mon, 21 Oct 2013 19:53:44 +0300 (IDT) Date: Mon, 21 Oct 2013 16:53:00 -0000 From: Eli Zaretskii Subject: Expanding macros in breakpoint conditions To: gdb@sourceware.org Reply-to: Eli Zaretskii Message-id: <83vc0qk1jx.fsf@gnu.org> X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00069.txt.bz2 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