From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52233 invoked by alias); 4 Dec 2018 18:59:33 -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 52207 invoked by uid 89); 4 Dec 2018 18:59:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,MIME_BASE64_BLANKS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: sessmg23.ericsson.net Received: from sessmg23.ericsson.net (HELO sessmg23.ericsson.net) (193.180.251.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Dec 2018 18:59:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1543949968; x=1546541968; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qM3T2A6hp0Oq2RreKlabxR6kARPRh20G7RXYrKPP9O8=; b=M8kDoRRe86lvJWe+iD7WdgCjjMbOQpZml4e6H5Ej+3xRMOIeoEA5p/StsleXf2K5 cM1JMu8rXC5Yn/76Kc2OQY1udOiDkWCq+qC1QYDK6Dkhm9abG8jcucqmT310vU09 v03cYqyKO6bHFLoa93RDGvM1ShJ/COGAgKDn/eW0tm8=; Received: from ESESBMB503.ericsson.se (Unknown_Domain [153.88.183.116]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id 82.FC.31473.09EC60C5; Tue, 4 Dec 2018 19:59:28 +0100 (CET) Received: from ESESSMR502.ericsson.se (153.88.183.110) by ESESBMB503.ericsson.se (153.88.183.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Tue, 4 Dec 2018 19:59:28 +0100 Received: from ESESBMB505.ericsson.se (153.88.183.172) by ESESSMR502.ericsson.se (153.88.183.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Tue, 4 Dec 2018 19:59:28 +0100 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (153.88.183.157) by ESESBMB505.ericsson.se (153.88.183.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Tue, 4 Dec 2018 19:59:27 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qM3T2A6hp0Oq2RreKlabxR6kARPRh20G7RXYrKPP9O8=; b=b+dSCzKImt2Ke8tGFmeSH2UKV639WuJY1B/Gng5xKUEPU3EaqQtBls3FsAfzb4pPF76iqY7OhfremCQk6mcMEXaEwE5/XRqmhBqEoRlf21La3k0pKDhMGuKKdcpRgPiU0Gds9GRgRlUAcHAbrQzwnagRRyLtFebLrSERO4zXY3U= Received: from BYAPR15MB2390.namprd15.prod.outlook.com (52.135.198.30) by BYAPR15MB2822.namprd15.prod.outlook.com (20.179.158.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.22; Tue, 4 Dec 2018 18:59:25 +0000 Received: from BYAPR15MB2390.namprd15.prod.outlook.com ([fe80::2978:b8d7:86fd:94ed]) by BYAPR15MB2390.namprd15.prod.outlook.com ([fe80::2978:b8d7:86fd:94ed%3]) with mapi id 15.20.1382.020; Tue, 4 Dec 2018 18:59:25 +0000 From: Simon Marchi To: Pedro Alves , "gdb-patches@sourceware.org" Subject: Re: [PATCH] Fix gdb build on 32-bit hosts w/ --enable-64-bit-bfd Date: Tue, 04 Dec 2018 18:59:00 -0000 Message-ID: <222885d8-9f9f-7808-3ee2-25043f95171b@ericsson.com> References: <20181204181650.18188-1-palves@redhat.com> In-Reply-To: <20181204181650.18188-1-palves@redhat.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) Content-Type: text/plain; charset="utf-8" Content-ID: <73165ECBEA830B4F99426361BF5F0768@namprd15.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 Return-Path: simon.marchi@ericsson.com X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00043.txt.bz2 T24gMjAxOC0xMi0wNCAxOjE2IHAubS4sIFBlZHJvIEFsdmVzIHdyb3RlOg0K PiBCdWlsZGluZyBmb3IgeDg2XzY0Ly1tMzIgd2l0aCAtLWVuYWJsZS02NC1i aXQtYmZkLCBjb21waWxhdGlvbiBmYWlscw0KPiB3aXRoOg0KPiANCj4gIHNy Yy9nZGIvZHdhcmYycmVhZC5jOiBJbiBpbnN0YW50aWF0aW9uIG9mIOKAmGdk Yjo6YXJyYXlfdmlldzxjb25zdCB1bnNpZ25lZCBjaGFyPiBnZXRfZ2RiX2lu ZGV4X2NvbnRlbnRzX2Zyb21fc2VjdGlvbihvYmpmaWxlKiwgVCopIFt3aXRo IFQgPSBkd2FyZjJfcGVyX29iamZpbGVd4oCZOg0KPiAgc3JjL2dkYi9kd2Fy ZjJyZWFkLmM6NjI2Njo1NDogICByZXF1aXJlZCBmcm9tIGhlcmUNCj4gIHNy Yy9nZGIvZHdhcmYycmVhZC5jOjYxOTI6Mzc6IGVycm9yOiBuYXJyb3dpbmcg Y29udmVyc2lvbiBvZiDigJhzZWN0aW9uLT5kd2FyZjJfc2VjdGlvbl9pbmZv OjpzaXpl4oCZIGZyb20g4oCYYmZkX3NpemVfdHlwZSB7YWthIGxvbmcgbG9u ZyB1bnNpZ25lZCBpbnR94oCZIHRvIOKAmHNpemVfdCB7YWthIHVuc2lnbmVk IGludH3igJkgaW5zaWRlIHsgfSBbLVdlcnJvcj1uYXJyb3dpbmddDQo+ICAg ICByZXR1cm4ge3NlY3Rpb24tPmJ1ZmZlciwgc2VjdGlvbi0+c2l6ZX07DQo+ IAkJCSAgICAgfn5+fn5+fn5+Xn5+fg0KPiANCj4gVGhpcyBmaXhlcyBpdC4N Cg0KV29vcHMsIHRoYW5rcywgTEdUTS4NCg0KU2ltb24NCg== >From gdb-patches-return-152702-listarch-gdb-patches=sources.redhat.com@sourceware.org Tue Dec 04 21:05:28 2018 Return-Path: Delivered-To: listarch-gdb-patches@sources.redhat.com Received: (qmail 30307 invoked by alias); 4 Dec 2018 21:05:28 -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 Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 30265 invoked by uid 89); 4 Dec 2018 21:05:27 -0000 Authentication-Results: sourceware.org; auth=none 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,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=UD:y, fortranexp, 10200, Bernhard 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; Tue, 04 Dec 2018 21:05:21 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.pl.sii.eu (Postfix) with ESMTP id 54A52386D; Tue, 4 Dec 2018 22:05:18 +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 qgNyuwWqM3jn; Tue, 4 Dec 2018 22:05:16 +0100 (CET) Received: from PRDSWEX16W1.SIIPOLSKA.PL (PRDSWEX16W1.SIIPOLSKA.PL [10.254.15.205]) by mail.pl.sii.eu (Postfix) with ESMTPS id 4591125F4; Tue, 4 Dec 2018 22:05:16 +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; Tue, 4 Dec 2018 22:05:11 +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; Tue, 4 Dec 2018 22:05:11 +0100 From: =?iso-8859-2?Q?Pawe=B3_W=F3dkowski?= To: Richard Bunt , "gdb-patches@sourceware.org" CC: nd Subject: Re: [PATCH v2 3/7] Fortran: Accessing fields of inherited types via fully qualified name. Date: Tue, 04 Dec 2018 21:05:00 -0000 Message-ID: <53cac622aea64147b2c1cd25feb16bdd@pl.sii.eu> References: <1542663530-140490-1-git-send-email-pwodkowski@pl.sii.eu> <1542663530-140490-3-git-send-email-pwodkowski@pl.sii.eu> <88ec6786-8834-7da2-207a-7392fd657e41@arm.com> Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2018-12/txt/msg00044.txt.bz2 Content-length: 9461 On 03.12.2018 14:44, Richard Bunt wrote: > Hi Pawel, >=20 > Is there a compiler where all the marked kfails pass? I've given this pat= ch a spin > with the Fortran compilers from various vendors, but there is a varying n= umber of kfails. >=20 To be honest I'm testing gfortran and ifort and both are producing the=20 same six kfails. Which compilers are you testing against? I can add them to the CI if=20 required. Pawel > I'd like to test everything if possible. >=20 > Many thanks, >=20 > Rich >=20 > On 11/19/18 9:38 PM, Pawel Wodkowski wrote: >> From: Bernhard Heckel >> >> Fortran 2003 supports type extension. This patch allows access >> to inherited members by using it's fully qualified name as >> described in the fortran standard. >> >> Before: >> (gdb) print my_extended_obj%base_class_name%member_base >> Syntax error near base_class_name%member_base >> >> (gdb) print my_extended_obj%member_base >> $1 =3D (10, 10, 10) >> >> After: >> (gdb) print my_extended_obj%base_clase_name%member_base >> $1 =3D (10, 10, 10) >> >> (gdb) print my_extended_obj%member_base >> $1 =3D (10, 10, 10) >> >> 2016-04-22 Bernhard Heckel >> >> gdb/Changelog: >> * f-exp.y (name): Allow TYPENAME. >> * valops.c (search_struct_method): Look also for baseclass. >> >> gdb/Testsuite/Changelog: >> * gdb.fortran/oop-extend-type.f90: New. >> * gdb.fortran/oop-extend-type.exp: New. >> --- >> gdb/f-exp.y | 7 +- >> gdb/testsuite/gdb.fortran/oop-extend-type.exp | 113 ++++++++++++++++++= ++++++++ >> gdb/testsuite/gdb.fortran/oop-extend-type.f90 | 56 +++++++++++++ >> gdb/valops.c | 6 ++ >> 4 files changed, 180 insertions(+), 2 deletions(-) >> create mode 100644 gdb/testsuite/gdb.fortran/oop-extend-type.exp >> create mode 100644 gdb/testsuite/gdb.fortran/oop-extend-type.f90 >> >> diff --git a/gdb/f-exp.y b/gdb/f-exp.y >> index 390bd45081b7..4c2e101699ac 100644 >> --- a/gdb/f-exp.y >> +++ b/gdb/f-exp.y >> @@ -604,8 +604,11 @@ nonempty_typelist >> } >> ; >>=20=20=20 >> -name : NAME >> - { $$ =3D $1.stoken; } >> +name >> + : NAME >> + { $$ =3D $1.stoken; } >> + | TYPENAME >> + { $$ =3D $1.stoken; } >> ; >>=20=20=20 >> name_not_typename : NAME >> diff --git a/gdb/testsuite/gdb.fortran/oop-extend-type.exp b/gdb/testsui= te/gdb.fortran/oop-extend-type.exp >> new file mode 100644 >> index 000000000000..8c3bb50a3ac6 >> --- /dev/null >> +++ b/gdb/testsuite/gdb.fortran/oop-extend-type.exp >> @@ -0,0 +1,113 @@ >> +# Copyright 2018 Free Software Foundation, Inc. >> + >> +# This program is free software; you can redistribute it and/or modify >> +# it under the terms of the GNU General Public License as published by >> +# the Free Software Foundation; either version 3 of the License, or >> +# (at your option) any later version. >> +# >> +# This program is distributed in the hope that it will be useful, >> +# but WITHOUT ANY WARRANTY; without even the implied warranty of >> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> +# GNU General Public License for more details. >> +# >> +# You should have received a copy of the GNU General Public License >> +# along with this program. If not, see . >> + >> +standard_testfile ".f90" >> +load_lib "fortran.exp" >> + >> +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ >> + {debug f90 quiet}] } { >> + return -1 >> +} >> + >> +if ![runto_main] { >> + untested "could not run to main" >> + return -1 >> +} >> + >> +# Depending on the compiler being used, the type names can be printed d= ifferently. >> +set real [fortran_real4] >> + >> +gdb_breakpoint [gdb_get_line_number "! Before vla allocation"] >> +gdb_continue_to_breakpoint "! Before vla allocation" ".*! Before vla al= location" >> +gdb_test "whatis wp_vla" "type =3D " >> + >> +gdb_breakpoint [gdb_get_line_number "! After value assignment"] >> +gdb_continue_to_breakpoint "! After value assignment" ".*! After value = assignment" >> +set test "p wp%coo" >> +gdb_test_multiple "$test" "$test" { >> + -re " =3D \\(1, 2, 1\\)\r\n$gdb_prompt $" { >> + pass "$test" >> + } >> + -re "There is no member named coo.\r\n$gdb_prompt $" { >> + kfail "gcc/49475" "$test" >> + } >> +} >> +gdb_test "p wp%point%coo" " =3D \\(1, 2, 1\\)" >> +gdb_test "p wp%point" " =3D \\( coo =3D \\(1, 2, 1\\) \\)" >> +gdb_test "p wp" " =3D \\( point =3D \\( coo =3D \\(1, 2, 1\\) \\), angl= e =3D 100 \\)" >> + >> +gdb_test "whatis wp" "type =3D Type waypoint" >> +set output_pass [multi_line "type =3D Type, extends\\(point\\) :: waypo= int" \ >> + " Type point :: point" \ >> + " $real :: angle" \ >> + "End Type waypoint"] >> +set output_kfail [multi_line "type =3D Type waypoint" \ >> +" Type point :: point" \ >> +" $real :: angle" \ >> +"End Type waypoint"] >> +set test "ptype wp" >> +gdb_test_multiple $test %test { >> + -re "$output_pass\r\n$gdb_prompt $" { >> + pass "$test" >> + } >> + -re "$output_kfail\r\n$gdb_prompt $" { >> + kfail "gcc/49475" "$test" >> + } >> +} >> + >> +set test "ptype wp%coo" >> +gdb_test_multiple "$test" "$test" { >> + -re "$real \\(3\\)\r\n$gdb_prompt $" { >> + pass "$test" >> + } >> + -re "There is no member named coo.\r\n$gdb_prompt $" { >> + kfail "gcc/49475" "$test" >> + } >> +} >> +gdb_test "ptype wp%point%coo" "$real \\(3\\)" >> + >> +set test "p wp_vla(1)%coo" >> +gdb_test_multiple "$test" "$test" { >> + -re " =3D \\(10, 12, 10\\)\r\n$gdb_prompt $" { >> + pass "$test" >> + } >> + -re "There is no member named coo.\r\n$gdb_prompt $" { >> + kfail "gcc/49475" "$test" >> + } >> +} >> +gdb_test "p wp_vla(1)%point%coo" " =3D \\(10, 12, 10\\)" >> +gdb_test "p wp_vla(1)%point" " =3D \\( coo =3D \\(10, 12, 10\\) \\)" >> +gdb_test "p wp_vla(1)" " =3D \\( point =3D \\( coo =3D \\(10, 12, 10\\)= \\), angle =3D 101 \\)" >> + >> +gdb_test "whatis wp_vla" "type =3D Type waypoint \\(3\\)" >> +set test "ptype wp_vla" >> +gdb_test_multiple $test %test { >> + -re "$output_pass \\(3\\)\r\n$gdb_prompt $" { >> + pass "$test" >> + } >> + -re "$output_kfail \\(3\\)\r\n$gdb_prompt $" { >> + kfail "gcc/49475" "$test" >> + } >> +} >> +set test "ptype wp_vla(1)%coo" >> +gdb_test_multiple "$test" "$test" { >> + -re "$real \\(3\\)\r\n$gdb_prompt $" { >> + pass "$test" >> + } >> + -re "There is no member named coo.\r\n$gdb_prompt $" { >> + kfail "gcc/49475" "$test" >> + } >> +} >> +gdb_test "ptype wp_vla(1)%point%coo" "$real \\(3\\)" >> diff --git a/gdb/testsuite/gdb.fortran/oop-extend-type.f90 b/gdb/testsui= te/gdb.fortran/oop-extend-type.f90 >> new file mode 100644 >> index 000000000000..1fe8611f4632 >> --- /dev/null >> +++ b/gdb/testsuite/gdb.fortran/oop-extend-type.f90 >> @@ -0,0 +1,56 @@ >> +! Copyright 2018 Free Software Foundation, Inc. >> +! >> +! This program is free software; you can redistribute it and/or modify >> +! it under the terms of the GNU General Public License as published by >> +! the Free Software Foundation; either version 3 of the License, or >> +! (at your option) any later version. >> +! >> +! This program is distributed in the hope that it will be useful, >> +! but WITHOUT ANY WARRANTY; without even the implied warranty of >> +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> +! GNU General Public License for more details. >> +! >> +! You should have received a copy of the GNU General Public License >> +! along with this program. If not, see . >> + >> +module testmod >> + implicit none >> + type :: point >> + real :: coo(3) >> + end type >> + >> + type, extends(point) :: waypoint >> + real :: angle >> + end type >> + >> +end module >> + >> +program testprog >> + use testmod >> + implicit none >> + >> + logical l >> + type(waypoint) :: wp >> + type(waypoint), allocatable :: wp_vla(:) >> + >> + l =3D allocated(wp_vla) >> + allocate(wp_vla(3)) ! Before vla allocation >> + >> + l =3D allocated(wp_vla) ! After vla allocation >> + wp%angle =3D 100.00 >> + wp%point%coo(:) =3D 1.00 >> + wp%point%coo(2) =3D 2.00 >> + >> + wp_vla(1)%angle =3D 101.00 >> + wp_vla(1)%point%coo(:) =3D 10.00 >> + wp_vla(1)%point%coo(2) =3D 12.00 >> + wp_vla(2)%angle =3D 102.00 >> + wp_vla(2)%point%coo(:) =3D 20.00 >> + wp_vla(2)%point%coo(2) =3D 22.00 >> + wp_vla(3)%angle =3D 103.00 >> + wp_vla(3)%point%coo(:) =3D 30.00 >> + wp_vla(3)%point%coo(2) =3D 32.00 >> + >> + print *, wp, wp_vla ! After value assignment >> + >> +end program >> diff --git a/gdb/valops.c b/gdb/valops.c >> index c45caefbf1e0..a34e74b2bee9 100644 >> --- a/gdb/valops.c >> +++ b/gdb/valops.c >> @@ -2163,6 +2163,12 @@ value_struct_elt (struct value **argp, struct val= ue **args, >> if (v) >> return v; >>=20=20=20 >> + /* fortran: If it is not a field it is the >> + type name of an inherited structure */ >> + v =3D search_struct_field (name, *argp, t, 1); >> + if (v) >> + return v; >> + >> /* C++: If it was not found as a data field, then try to >> return it as a pointer to a method. */ >> v =3D search_struct_method (name, argp, args, 0, >> >=20