From patchwork Wed Jun 13 12:56:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 27781 Received: (qmail 24169 invoked by alias); 13 Jun 2018 12:56:43 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 24160 invoked by uid 89); 13 Jun 2018 12:56:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=coincidentally X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 13 Jun 2018 12:56:41 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 957898185331; Wed, 13 Jun 2018 12:56:39 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 222672024CA6; Wed, 13 Jun 2018 12:56:38 +0000 (UTC) Subject: Re: [PATCH, testsuite] Allow function arguments in bp print match in selftest_setup To: Tom de Vries , gdb-patches@sourceware.org References: <20180612151500.xgw27odexd5fgyww@localhost.localdomain> From: Pedro Alves Message-ID: <8f1dae31-ac6c-74e2-1851-ca885193aa89@redhat.com> Date: Wed, 13 Jun 2018 13:56:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180612151500.xgw27odexd5fgyww@localhost.localdomain> 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. [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, 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? 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(-) Thanks, Pedro Alves 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