From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28026 invoked by alias); 30 Nov 2011 20:19:18 -0000 Received: (qmail 28007 invoked by uid 22791); 30 Nov 2011 20:19:13 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 Nov 2011 20:18:53 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pAUKIqEN022420 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 30 Nov 2011 15:18:52 -0500 Received: from host2.jankratochvil.net (ovpn-116-69.ams2.redhat.com [10.36.116.69]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pAUKImPn004447 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Wed, 30 Nov 2011 15:18:51 -0500 Date: Wed, 30 Nov 2011 20:19:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: Re: [RFA] Allow setting breakpoints on inline functions (PR 10738) Message-ID: <20111130201848.GA12763@host2.jankratochvil.net> References: <20111129150200.GB3425@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111129150200.GB3425@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-11/txt/msg00857.txt.bz2 On Tue, 29 Nov 2011 16:02:00 +0100, Gary Benson wrote: > I'm also interested in feedback about the tests I've > written, since this is the first time I've worked on the testsuite. I would prefer definitely a copy in gdb.dwarf2/ . gdb.opt/ I find a bad idea as it breaks too much across GCC changes. just gcc -S -dA is probably OK. If there is gdb.dwarf2/ then I would even drop the gdb.opt/ one. Not sure if it makes sense for non-DWARF targets, the functionality gets tested by the DWARF targets anyway. > --- /dev/null > +++ b/gdb/testsuite/gdb.opt/inline-break.exp ... > +if { [prepare_for_testing $testfile.exp $testfile $testfile.c \ > + {debug optimize=-O2 additional_flags=-Winline}] } { This -Winline is questionable. You make the .c file compatible even if __GNUC__ is not defined but then you use GCC-specific -Winline option. Either just make the testcase whole GCC-specific or make a fallback if the compilation with -Winline fails try also non-Winline. Or maybe just drop that -Winline, there is no -Werror anyway so it was more just for the testcase development. As I suggested the gdb.dwarf2/ way this whole -Winline is offtopic then. > +# > +# func1 is a static inlined function that is called once. > +# The result should be a single-location breakpoint. > +# > +gdb_test "break func1" \ > + "Breakpoint.*at.* file .*$testfile\.c, line.*" As you use "" and not {} you should use \\.c and not \.c . This way it is the same as .c . It is there several times. > +# func2 is a non-static inlined function that is called once. > +# The result should be a breakpoint with two locations: the > +# out-of-line function and the single inlined instance. > +# > +gdb_test "break func2" \ > + "Breakpoint.*at.*func2.*(2 locations).*" You wanted to use \\( and \\) here. It is there several times. Thanks, Jan