From patchwork Thu Jun 14 10:45:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 27844 Received: (qmail 128817 invoked by alias); 14 Jun 2018 10:46:09 -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 128560 invoked by uid 89); 14 Jun 2018 10:45:52 -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= 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; Thu, 14 Jun 2018 10:45:49 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 54826407541A; Thu, 14 Jun 2018 10:45:43 +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 BDD2D1C5B8; Thu, 14 Jun 2018 10:45:42 +0000 (UTC) Subject: Re: [PATCH, testsuite] Allow function arguments in bp print match in selftest_setup To: Tom de Vries References: <20180612151500.xgw27odexd5fgyww@localhost.localdomain> <8f1dae31-ac6c-74e2-1851-ca885193aa89@redhat.com> <20180614102107.cgh6iixu324pmpvi@localhost.localdomain> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <51e2fa52-222b-6ec0-16d3-8c99fcc9a310@redhat.com> Date: Thu, 14 Jun 2018 11:45:42 +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: <20180614102107.cgh6iixu324pmpvi@localhost.localdomain> On 06/14/2018 11:21 AM, Tom de Vries wrote: >> [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. Please don't be shy about stating those things upfront, makes review easier. :-) > >> 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. Alright, I've pushed this, as below. From 1d39de443a38448226ffc408290c17c54c598c39 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 14 Jun 2018 11:40:23 +0100 Subject: [PATCH] Remove stale inline function handling from selftest_setup Before commit 70ee000084aa ("[gdb] Allow function arguments in bp print match in selftest_setup"), this pattern in selftest_setup: -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" } happened to match if captured_main_1 was inlined and captured_main was not, because captured_main calls captured_main_1 first thing, which coincidentally matches "$function.*": Breakpoint 1, captured_main (data=) at 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 is to remove 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. gdb/testsuite/ChangeLog: 2018-06-14 Pedro Alves * lib/selftest-support.exp (selftest_setup): Remove inlined function handling. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/lib/selftest-support.exp | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 723fa299a38..fd6b8fcbf2f 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-06-14 Pedro Alves + + * lib/selftest-support.exp (selftest_setup): Remove inlined + function handling. + 2018-06-14 Tom de Vries * lib/selftest-support.exp (selftest_setup): Allow function arguments in diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp index 0542861e78b..887ea20d73a 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