From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63513 invoked by alias); 14 Jun 2018 10:21:13 -0000 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 Received: (qmail 63500 invoked by uid 89); 14 Jun 2018 10:21:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Jun 2018 10:21:10 +0000 Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 715C1AEE9; Thu, 14 Jun 2018 10:21:08 +0000 (UTC) Date: Thu, 14 Jun 2018 10:21:00 -0000 From: Tom de Vries To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH, testsuite] Allow function arguments in bp print match in selftest_setup Message-ID: <20180614102107.cgh6iixu324pmpvi@localhost.localdomain> References:<20180612151500.xgw27odexd5fgyww@localhost.localdomain> <8f1dae31-ac6c-74e2-1851-ca885193aa89@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To:<8f1dae31-ac6c-74e2-1851-ca885193aa89@redhat.com> User-Agent: NeoMutt/20170912 (1.9.0) X-IsSubscribed: yes X-SW-Source: 2018-06/txt/msg00352.txt.bz2 On Wed, Jun 13, 2018 at 01:56:38PM +0100, Pedro Alves wrote: > On 06/12/2018 04:15 PM, Tom de Vries wrote: > > Hi, > > > > atm selftest.exp fails for me. > > > > [1] > > > One of the reasons is that setting the breakpoint on captured_main and running > > to it gives us: > > ... > > Breakpoint 1, captured_main (data=data@entry=0x7fffffffdb80) at main.c:1144 > > ... > > while the matching in selftest_setup only allows '()', like this: > > ... > > Breakpoint 1, captured_main () at main.c:1144 > > ... > > > > The patch fixes this by allowing for random strings inbetween the parentheses. > > > > Tested selftest.exp (with two other selftest.exp related fixes applied). > > > > OK for trunk? > > Yes, please push. > Done. > [1] Funny, it passes for me (with the fix for stopping at captured_main), > because the pattern below the one you're touching matches: > > -re "Starting program.*Breakpoint \[0-9\]+,.* at .*main.c:.*$function.*$gdb_prompt $" { > # $function may be inlined, so the program stops at the line > # calling $function. > pass "$description" > } > > and it only happens to match because captured_main calls > captured_main_1 first thing, which coincidentally > matches "$function.*": > > Breakpoint 1, captured_main (data=) at gdb/binutils-gdb/src/gdb/main.c:1147 > 1147 captured_main_1 (context); > > That would probably be better "$function .*", with a space, Right, I observed that as well, and was thinking of this type of fix. > but I > think that even better, we should try removing the "may be inlined" case > too now, because since ddfe970e6bec ("Don't elide all inlined frames") GDB > presents the stop at the inline function instead of at the caller. > Like below. Comments? > Agreed, that's a better solution. Thanks, - Tom > From: Pedro Alves > Date: 2018-06-13 13:44:16 +0100 > > remove inline > --- > > gdb/testsuite/lib/selftest-support.exp | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp > index f7169e0955e..c05f3b119be 100644 > --- a/gdb/testsuite/lib/selftest-support.exp > +++ b/gdb/testsuite/lib/selftest-support.exp > @@ -94,11 +94,6 @@ proc selftest_setup { executable function } { > -re "Starting program.*Breakpoint \[0-9\]+,.*$function \\(\\).*$gdb_prompt $" { > xfail "$description (line numbers scrambled?)" > } > - -re "Starting program.*Breakpoint \[0-9\]+,.* at .*main.c:.*$function.*$gdb_prompt $" { > - # $function may be inlined, so the program stops at the line > - # calling $function. > - pass "$description" > - } > -re "vfork: No more processes.*$gdb_prompt $" { > fail "$description (out of virtual memory)" > set timeout $oldtimeout > > Thanks, > Pedro Alves