From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by sourceware.org (Postfix) with ESMTPS id D4DAE385BF93 for ; Fri, 18 Feb 2022 16:14:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D4DAE385BF93 X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="238559261" X-IronPort-AV: E=Sophos;i="5.88,379,1635231600"; d="scan'208";a="238559261" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2022 08:14:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,379,1635231600"; d="scan'208";a="775327724" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga006.fm.intel.com with ESMTP; 18 Feb 2022 08:14:52 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 18 Feb 2022 08:14:51 -0800 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 18 Feb 2022 08:14:51 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Fri, 18 Feb 2022 08:14:51 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.169) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Fri, 18 Feb 2022 08:14:51 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CkxrHqgwiCbPG37lKWyvq9MFWaECl1Hja7AFlkwK3oZ1t+7P6IIhSJqwNTxwaxqqy6IzYdnKAEOwSpjCCFIg+Jw47XHiCD6L4tOOGGGztXNttNIuznipp0nkSbQVH69A5/wbSaALnI+4d5bsALUDARS2Ziu2KJCi7fJtVEG+sIu8qMYRY59UuKmXsgr5JioFguNgfyLCZO8hsrNRoRa5cXar6JIC7IOfPwHYBEHNxahG2V+l0HCRn0TmY1y/krJGE+PhrvX3rmiwXazme89LnD7wO8Zo5Lu1uMy+4MSo7wK927BgIHAXkznhFqVpmBud+Bw6zSzDxwLWx8D/B3tBKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BJW5e6WTGK563S89sR9h6Dfr3PYXmlITVVG/LTamhmY=; b=NyLRZGQ2FZmicfy2kG8VjUDS0unZO1VV4WKSJCVKxyGyE3TC9n5uEtNg4AJCg4jSm5aEUzTK9e++fU8lrkKrfd2uUED0alZ5iLbZndt2xjJ5EWSe+hMyE7F6EC4gzjEE+icw8igD/0Fsx6+PchJ6Mcn45qoqPxPYMgYCkPD3HITc/TKONM7jAdArd8Rgmfi85I+rvtUwSYkgEs9flWBXgz3WWPApQ/wGEbNLoaxHSOiiGBKtfBQk1rWpsEAX5QWu887FbumBGW04WqcDAnYQ/1zvbfXYb05pcrHW2V1PSvtaLcE0FH69zbAqqCQ83psCJgaCmKWMgs/1QX8dvpBMBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from CY4PR1101MB2071.namprd11.prod.outlook.com (2603:10b6:910:1a::10) by DM6PR11MB3946.namprd11.prod.outlook.com (2603:10b6:5:19d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.17; Fri, 18 Feb 2022 16:14:49 +0000 Received: from CY4PR1101MB2071.namprd11.prod.outlook.com ([fe80::ecc8:4cf5:3f52:24c6]) by CY4PR1101MB2071.namprd11.prod.outlook.com ([fe80::ecc8:4cf5:3f52:24c6%11]) with mapi id 15.20.4995.022; Fri, 18 Feb 2022 16:14:49 +0000 From: "Kempke, Nils-Christian" To: Tom Tromey , Nils-Christian Kempke via Gdb-patches Subject: RE: [PATCH 1/2][PR fortran/26373][PR fortran/22497] gdb/fortran: add support for accessing fields of extended types Thread-Topic: [PATCH 1/2][PR fortran/26373][PR fortran/22497] gdb/fortran: add support for accessing fields of extended types Thread-Index: AQHYCJwrxeDWsm/IikOQB4yt8aER66xi80olgAP6V6CAF/uVcIAOBwzggAzDttA= Date: Fri, 18 Feb 2022 16:14:49 +0000 Message-ID: References: <20220113163909.2880018-1-nils-christian.kempke@intel.com> <20220113163909.2880018-2-nils-christian.kempke@intel.com> <87h7a6f5fu.fsf@tromey.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.200.16 dlp-reaction: no-action x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3635eaf7-7c4c-4930-baa8-08d9f2f9c9e9 x-ms-traffictypediagnostic: DM6PR11MB3946:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8Pmo3bgOmnEjJJs2QpFoYyNqUEtul8YNkzSrj6bb0Dp84y5DRI3x6i1k0TIbJSpcXfrZztOUVD2Cu2k32h04M5T0J/NK712gHRxVt1tqav3ReXnPUuLvJlk6exwHMNKlyAmr7LK/4ZySftK/63oDY4bwTGE0jg6kfo6hQl34fePTTeG9WoB8pf/COEhJ0DW5O/Z39q2UOWmun9XFHWAL6TITJnvG/W7RRkqFIL3J31fickPHGbSPi1FPiai5aydaqaj6+0xk8bqBHKr1QpVbenWBPEFJb+ChCgSXpIFYMywokts80X2W9AfHyMgQZ06z4c1QXCKmfGg6jcX8TwmNKFQSkSLUlhyZ61VD8rVegP6xqbO07uaGAM2TOwml/MtyRSnfpDurW6BWhosr3270DvOjJappBjLtIU/NZLWm+rej+hv33g0P/CRZduTTHVbzEBiRikHCPBRZRzTxZ+UhxrFdjbZdVz/aiXTVlFYdHwKjlAWiz6mlxVMDSwkTaJEi84Ggp+RMJSwi4b284LPG8l5v2j+XsjoE0var44lKc/kjDPBPjcR4QWL33d47MnfUv+su0UA6+DqSrwRZyg/X7e77X3LqhRaPgoJSTAHN7sP/utbhDbCJOxnFiOWTLJ8wkDqGjLfzYsHC0rFOE9PR3M3mumi8wr1VtRZZgerZJBLeIZ/a5XBwjEkE5WpWO485v1ScuRtV32orHiYAbDV2fYQVXWvTWr3YzSNAtRLmyWepCJgbaDz7UK013MCJOS1AWA92wC7AkhXU2SDYxp3s5lhPQakxco4hRp/qpeYEBrg= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR1101MB2071.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(2906002)(9686003)(110136005)(15974865002)(66446008)(508600001)(66946007)(8676002)(76116006)(33656002)(66476007)(64756008)(66556008)(7696005)(6506007)(71200400001)(316002)(53546011)(8936002)(86362001)(52536014)(186003)(26005)(83380400001)(5660300002)(55016003)(38070700005)(38100700002)(82960400001)(122000001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messaged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text/plain; charset="us-ascii" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR1101MB2071.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3635eaf7-7c4c-4930-baa8-08d9f2f9c9e9 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2022 16:14:49.7483 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 4czOYkfpDr/7+qrb36HiP0MW+yoOMU1yDe7WiznshO9c74glCf4/oav+aRZZ2hL5VJQ9B9Ov2dcqfJvo150nuO0t4fnn260dhkWzt7du6tw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3946 X-OriginatorOrg: intel.com Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2022 16:14:56 -0000 [PING**3] Cheers, Nils > -----Original Message----- > From: Kempke, Nils-Christian > Sent: Thursday, February 10, 2022 2:20 PM > To: 'Tom Tromey' ; 'Nils-Christian Kempke via Gdb- > patches' > Subject: RE: [PATCH 1/2][PR fortran/26373][PR fortran/22497] gdb/fortran: > add support for accessing fields of extended types > = > [PING**2] > = > Cheers, > Nils > = > > -----Original Message----- > > From: Kempke, Nils-Christian > > Sent: Tuesday, February 1, 2022 4:07 PM > > To: Tom Tromey ; Nils-Christian Kempke via Gdb- > > patches > > Subject: RE: [PATCH 1/2][PR fortran/26373][PR fortran/22497] gdb/fortra= n: > > add support for accessing fields of extended types > > > > Kindly pinging for thoughts. > > > > Cheers, > > Nils > > > > > -----Original Message----- > > > From: Gdb-patches > > christian.kempke=3Dintel.com@sourceware.org> On Behalf Of Kempke, > Nils- > > > Christian via Gdb-patches > > > Sent: Monday, January 17, 2022 11:28 AM > > > To: Tom Tromey ; Nils-Christian Kempke via Gdb- > > > patches > > > Subject: RE: [PATCH 1/2][PR fortran/26373][PR fortran/22497] > gdb/fortran: > > > add support for accessing fields of extended types > > > > > > Hi Tom, > > > > > > > -----Original Message----- > > > > From: Tom Tromey > > > > Sent: Friday, January 14, 2022 9:06 PM > > > > To: Nils-Christian Kempke via Gdb-patches > > patches@sourceware.org> > > > > Cc: Kempke, Nils-Christian ; > Bernhard > > > > Heckel > > > > Subject: Re: [PATCH 1/2][PR fortran/26373][PR fortran/22497] > > gdb/fortran: > > > > add support for accessing fields of extended types > > > > > > > > >>>>> ">" =3D=3D Nils-Christian Kempke via Gdb-patches > > > patches@sourceware.org> writes: > > > > > > > > >> From: Bernhard Heckel > > > > >> Fortran 2003 supports type extension. This patch allows access > > > > >> to inherited members by using their fully qualified name as > described > > > > >> in the Fortran standard. > > > > > > > > Thanks for the patch. > > > > > > > > >> In doing so the patch also fixes a bug in GDB when trying to acc= ess > the > > > > >> members of a base class in a derived class via the derived class= ' base > > > > >> class member. > > > > > > > > >> @@ -2374,6 +2374,12 @@ value_struct_elt (struct value **argp, > > > > >> if (v) > > > > >> return v; > > > > > > > > >> + /* Fortran: If it is not a field it is the type name of a= n inherited > > > > >> + structure. */ > > > > >> + v =3D search_struct_field (name, *argp, t, 1); > > > > >> + if (v) > > > > >> + return v; > > > > > > > > Putting this here makes me wonder if it's possible to construct test > > > > cases in other languages that would work without this patch and then > > > > fail with it. > > > > > > Well, since this patch so far did not care about the language actuall= y used, > > > it enables one to do things like > > > > > > (gdb) p derived_obj > > > $1 =3D { =3D {...}, } > > > (gdb) p derived_obj.base > > > $2 =3D {...} > > > > > > in all languages, which probably is unexpected. The above example > would > > be > > > C++ and some class "derived" inheriting from "base". The syntax > > > derived_obj.base is no standard C++.. > > > I am not sure whether one would actually break things since the only > > leftover > > > check in the method is a (according to the comment) C++ specific one = for > > > member variables and I do not think that one can break C++ with the > > change. > > > > > > > > > > > I'm not sure what the options are though. Doing the work elsewhere, > say > > > > in a custom Fortran expression operation, might make the Python API > > > > harder to work with. Maybe having value_struct_elt check > > > > current_language would work... that's also quite ugly but other val= ue > > > > operations are doing that. > > > > > > Mh, I am not too sure about the Fortran expression - would that not > > require > > > a Fortran specific version of value_struct_elt? The methods > > > search_struct_method and search_struct_field are local to the valops.c > file > > > so > > > this would be a bigger redesign? I know that Ada has its own > > value_struct_elt > > > but it also implements the two helper methods. > > > > > > Checking the language seems ok to me, considering the style of the re= st > of > > > valops. > > > > > > On more option that is also cleaner than directly checking the type m= ight > be > > > to > > > generalize the concept of this "member access by base name" a bit and > add > > a > > > method - say base_access_by_base_type_name - to language.h allowing > > or > > > disallowing an access to the base type by its type name. Then one wo= uld > > > have to > > > loop over all base types in valops.c as well. I am not sure whether = there > > exist > > > other > > > languages that allow this kind of access though.. If not it might be = a bit > > much? > > > > > > Cheers, > > > > > > Nils > > > > > > > > > > > Or maybe my fears are overblown. > > > > > > > > Any thoughts on this? > > > > > > > > Tom > > > Intel Deutschland GmbH > > > Registered Address: Am Campeon 10, 85579 Neubiberg, Germany > > > Tel: +49 89 99 8853-0, www.intel.de > > > Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon S= ilva > > > Chairperson of the Supervisory Board: Nicole Lau > > > Registered Office: Munich > > > Commercial Register: Amtsgericht Muenchen HRB 186928 Intel Deutschland GmbH Registered Address: Am Campeon 10, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva = Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928