From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130146 invoked by alias); 2 Dec 2018 22:16:51 -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 130131 invoked by uid 89); 2 Dec 2018 22:16:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,GIT_PATCH_1,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=non-local, HTo:D*eu, nonlocal, HCC:D*com X-HELO: mail.pl.sii.eu Received: from mail.pl.sii.eu (HELO mail.pl.sii.eu) (91.227.21.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 02 Dec 2018 22:16:49 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.pl.sii.eu (Postfix) with ESMTP id 34B612588; Sun, 2 Dec 2018 23:16:47 +0100 (CET) Received: from mail.pl.sii.eu ([127.0.0.1]) by localhost (mail.pl.sii.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TNylMhfoBvoL; Sun, 2 Dec 2018 23:16:47 +0100 (CET) Received: from PRDSWEX16W1.SIIPOLSKA.PL (PRDSWEX16W1.SIIPOLSKA.PL [10.254.15.205]) by mail.pl.sii.eu (Postfix) with ESMTPS id 1F0AE2526; Sun, 2 Dec 2018 23:16:47 +0100 (CET) Received: from PRDSWEX16W1.SIIPOLSKA.PL (10.254.15.205) by PRDSWEX16W1.SIIPOLSKA.PL (10.254.15.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1531.3; Sun, 2 Dec 2018 23:16:46 +0100 Received: from PRDSWEX16W1.SIIPOLSKA.PL ([fe80::3c9b:ace1:3462:3aae]) by PRDSWEX16W1.SIIPOLSKA.PL ([fe80::3c9b:ace1:3462:3aae%9]) with mapi id 15.01.1531.003; Sun, 2 Dec 2018 23:16:46 +0100 From: =?iso-8859-2?Q?Pawe=B3_W=F3dkowski?= To: Richard Bunt , "gdb-patches@sourceware.org" , =?iso-8859-2?Q?Micha=B3_Urba=F1ski?= , Sebastian Basierski CC: "tim.wiederhake@intel.com" , "dragos.carciumaru@intel.com" , Bernhard Heckel , nd Subject: Re: [PATCH v2 5/7] Fortran: Enable setting breakpoint on nested functions. Date: Sun, 02 Dec 2018 22:16:00 -0000 Message-ID: References: <1542663530-140490-1-git-send-email-pwodkowski@pl.sii.eu> <1542663530-140490-5-git-send-email-pwodkowski@pl.sii.eu> Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2018-12/txt/msg00018.txt.bz2 Hi Richard, Please see my comments. On 28.11.2018 11:30, Richard Bunt wrote: > Hi Pawel, >=20 > Thanks for this fix, I have a local patch for this so I'd be pleased to s= ee an upstream variant. >=20 > Note: I cannot approve GDB patches but I thought I'd contribute a review = since I was in this part > of the code recently. >=20 Any review is great, especially from someone else developping for=20 fortran these days ;) > On 11/19/18 9:38 PM, Pawel Wodkowski wrote: >> +# Test if we can set a breakpoint in a nested function >> +gdb_breakpoint "sub_nested_outer" >> +gdb_continue_to_breakpoint "sub_nested_outer" ".*local_int =3D 19" >>=20=20=20 >> # Test if we can access local and >> # non-local variables defined one level up. >> @@ -43,6 +46,10 @@ gdb_test "print local_int" "=3D 19" "print local_int = in outer function" >> gdb_test "up" >> gdb_test "print index" "=3D 42" "print index at BP1, one frame up" >>=20=20=20 >> +# Test if we can set a breakpoint in a nested function >> +gdb_breakpoint "sub_nested_inner" >> +gdb_continue_to_breakpoint "sub_nested_inner" ".*local_int =3D 17" >> + >> # Test if we can access local and >> # non-local variables defined two level up. >> gdb_breakpoint [gdb_get_line_number "! BP_inner"] >> >=20 > This patch passed my local test case for this fix, so it looks good to me= . The only test case that > I have locally that I think would be of value here, would be to test that= breakpoints can be set on > multiple functions in the same contains block (i.e. both sub_nested_outer= and sub_nested_inner), > prior to program start. I found that such a test gives coverage to the ch= anges in > add_partial_subprogram as it tests the logic for subprograms which are li= nked as siblings. >=20 > What do you think? >=20 Yes, setting breakpoint before starting program is something that should=20 work for sure so I checked it. I'm happy to say that it is working for=20 both functions when set before MAIN__ :) I will change the tests. >> /* brobecker/2007-12-26: Normally, only "external" DIEs are = part >> of the global scope. But in Ada, we want to be able to a= ccess >> @@ -9206,6 +9208,8 @@ add_partial_subprogram (struct partial_die_info *p= di, >> { >> if (pdi->tag =3D=3D DW_TAG_entry_point) >> add_partial_entry_point (pdi, lowpc, highpc, set_addrmap, cu); >> + else if (pdi->tag =3D=3D DW_TAG_subprogram) >> + add_partial_subprogram (pdi, lowpc, highpc, set_addrmap, cu); >> pdi =3D pdi->die_sibling; >> } >> } >=20 >=20 > Many thanks, >=20 > Rich >=20 Pawel