From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by sourceware.org (Postfix) with ESMTPS id 98E753857C5A for ; Tue, 1 Feb 2022 15:07:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 98E753857C5A X-IronPort-AV: E=McAfee;i="6200,9189,10244"; a="272186972" X-IronPort-AV: E=Sophos;i="5.88,334,1635231600"; d="scan'208";a="272186972" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2022 07:07:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,334,1635231600"; d="scan'208";a="630425681" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga004.jf.intel.com with ESMTP; 01 Feb 2022 07:07:06 -0800 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 1 Feb 2022 07:07:06 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Tue, 1 Feb 2022 07:07:06 -0800 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.41) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Tue, 1 Feb 2022 07:07:06 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JuNFn+vJoPSNC7BmWLNKv5aoyIR9qftd1h8C+YtUlTOuzAuXxe/dHEHDMDoileVdhN+l0P9UxcX4D8qLfXlJJ4HHIgOLT0A/QbGnrB2zXpW3uUtjvyrJ3K9fJt3X+DbNENI2Z4L8hFOwEdF143fQuctgsqeMQF6YBSPIV81bR6NVTCu1Moevbhghao1A/BXjVPL4ojX2j3PgFyyRNM7xmLZ61rj6QFfLNguTfCaBFCUDO7HTs0FcHIshSNNpUbc3LXuNFFDvI8DIt64eZlvFlT9dZeS/OwwQ0vgUe5Wa378ZEvp5C5sdDZeQwY0mBfHO7uD7pL2sIQQWlO1Q3aULkw== 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=y7d/MvP+l7DYbV3sMNyP3jZZd09hScT1YK6p8E5fBA0=; b=R+Nqu4z8rSEAhkNNfLiVlOABQYiQlLnaj6Q6OVtlVUOCoblX8jHSlQxIA6SP5TcCOPXznDjLRdNHAzz364AOnhfLeOSFR5UZb9oW+GbDJjwMbAs1t32thDYashdATzZW2suws49rN1bmjzjAVo6rqTIP8/yA53eAhQNAvo3FEsdl5OprBP8fDEReYLmlNI9GhDscVyRq6lCb7X2jdrDeXTxptHq3HShNjSbU2KTBPmhQGteH3zbjLKD9ps2EJwpFP2NL3UEqp8wGC5G0cpeoQBGF5Y2I2laGtfdQ0w3PwCnSfTN1z4w3WY5Vtmj78Z7jsEHnDTx19MiaQDqKXoQvWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from BYAPR11MB3288.namprd11.prod.outlook.com (2603:10b6:a03:7e::33) by SN6PR11MB3534.namprd11.prod.outlook.com (2603:10b6:805:d0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.18; Tue, 1 Feb 2022 15:06:59 +0000 Received: from BYAPR11MB3288.namprd11.prod.outlook.com ([fe80::740e:38d7:a41b:e462]) by BYAPR11MB3288.namprd11.prod.outlook.com ([fe80::740e:38d7:a41b:e462%6]) with mapi id 15.20.4930.022; Tue, 1 Feb 2022 15:06:59 +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/uVcA== Date: Tue, 1 Feb 2022 15:06:59 +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: f5b15459-40ae-4561-fe38-08d9e5947ec4 x-ms-traffictypediagnostic: SN6PR11MB3534: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: qUBlxxlmEd6MKVRcxn5Mb5hSDS4Ubg91nQc6lQyL5pOT152D7MC2NIsTPpQ9cyeABfanVwCSsy+Ah4V7j68sukaI4jR5JdMCO5QhKCs2sc5Jv4qL0p/ND/vGN73gIXKliiNEODvgeOGxBh2IB5ty6fj/hJMjXGYEtCJZw8SQ6R8Icb8/JPv2+c00gLssh9fvXXt4/MYFETO1Zo9L9vd9Shz7rVHm4ynVQF9yL7kRRP06Hw3V2eiiGOpUKGwi4I7h6PGT+HakEkAGEnydxJaYtV2lJl75uRIWdnOgVWyY2f77ESHKu8CObjbGHc3w3ErLgFL78fyWGKnZykou0+rBdj6UNcw9xUmUpVVmKo9OSikSWRptzo6/pl7BzXYwH0TAUfqFSELh6mT25l1PSFOlbgLTXBRCRF5HnfkErF5lzoiJ5I6sEr1xK4Byo2RSPyF90UbpE+vRM7e9gYA9TW/A9UO+aU7njt25CjWTLkPxXhLTfgBGO7+CxbA3IP0aPYwPaJKFz/dYYBB/2kZwGKDWwBqcA2JinETnESFqRiFgOPBY+/OOTOTJpg5+i6ZEnrtrEHnw7sn6xYKF+S4I0tdWsBYy3NGLd1/60fcsyBj9B1TKNKjP+qvH4RnaNfB0wH+a7WBavbYmpsx3/hgKzR0swJwc4/aDn3S5eqv7tXXxL6NHDxo2fSWxPr1iJgU0VNT50C8Pp+ILrS4rpXRWX/k0UaOitpJvvfIhlEyBxuQHkS2YdVcvVoJnkKgd/DWv4Cl4oCgQ4ZyfnbQ/ilptokJcmkvMdBDmhkdoQtOwOUPArU4= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3288.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(5660300002)(82960400001)(2906002)(33656002)(122000001)(186003)(52536014)(26005)(316002)(53546011)(38070700005)(55016003)(8676002)(66946007)(66556008)(8936002)(64756008)(66446008)(66476007)(76116006)(71200400001)(38100700002)(9686003)(6506007)(508600001)(110136005)(86362001)(83380400001)(15974865002)(7696005)(20210929001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?OHrmPfJ+/I0hzLSFXpm2LXm4x85jwP5x8OAKmiutfb4f/2XkijGON9bLJ720?= =?us-ascii?Q?G/LxG6OwAz4JJFmyeMgZ7CSZFooqzM5lMzwnMMhafV7CL2swJ2RDETKfTxSD?= =?us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JKqZdSvKCMXM71t3Ytn1C4Jd7dHDbldkzF?= =?us-ascii?Q?Nu3QdF/p6yr4AYGElKECM0OjAuC6M1Yl9l4tPlC4rF4JEJzcuqwAZYo/XTlg?= =?us-ascii?Q?pS685Ux14BcUfMLkDjkcngrwPa1sJbzZtLdKz9EqBklAmjd76WYynSF3oOhp?= =?us-ascii?Q?MtaLCwLgUF13XtvcwyTCnwq5eDLhkpf9NOj5cDuZ217lPGIzFLbGjqyYNVun?= =?us-ascii?Q?pgUf1c5ECfSm+ofUYHq+pE8AjiNvKrZkarHEEuiVWnfcVlE7Evag4hW2ia83?= =?us-ascii?Q?5IN5B2qcOknniMW7uHvI6KrQzcH0YIU54ybLWs655NSoVcRUAzpsJ60QhhzT?= =?us-ascii?Q?ByOS9WRT9/y6NaTbVP90COlLIbfrGYb0rReUR41/gVqBHuCH0hw7ri/5sf2a?= =?us-ascii?Q?PWq88TJW+4IqZPClyLfpFjFx0qLZfF2/GgFjXiNl5YQC7W2reaQt0OLkGsR5?= =?us-ascii?Q?a+Va9tYoeRHAthh7bvoA8T483UvqSUhOHsYGgIBAGvh4zCtkYr+/4hRejmec?= =?us-ascii?Q?QxaiVYlMaD6qxuhDdVLY/+xyiriC8xE7Kh6VgRVgGBK0EtjFRt/7exMZ5R7W?= =?us-ascii?Q?F1V73TYBygjwt54rKxabYx+4HEZKqhYY9U113fKJPXPRf9u0V4X5ZgpLMms6?= =?us-ascii?Q?WqpRtWl4YBOADD+c/gOoVsfKNxtBB10wWycyF7Ku0gshSbEzfxT4PXeWuZ2j?= =?us-ascii?Q?jOUmhw=3D=3D?= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3288.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5b15459-40ae-4561-fe38-08d9e5947ec4 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Feb 2022 15:06:59.3145 (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: j0jSPTawU4vCdDiPEKoweAykALkKKJzCpIysRoxPFZotKEMQ3neXw491Mrb6yfg+HPcw2Cq65Y1d/C2sKsbVkdKStuwRkDInOVSvBoXyoIo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3534 X-OriginatorOrg: intel.com Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.8 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: Tue, 01 Feb 2022 15:07:11 -0000 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/fortra= n: > > 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 access = the > > >> members of a base class in a derived class via the derived class' ba= se > > >> 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 an in= herited > > >> + 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 actually us= ed, > 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 left= over > 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 chang= e. > = > > > > 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 value > > operations are doing that. > = > Mh, I am not too sure about the Fortran expression - would that not requi= re > a Fortran specific version of value_struct_elt? The methods > search_struct_method and search_struct_field are local to the valops.c fi= le > 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 rest of > valops. > = > On more option that is also cleaner than directly checking the type might= 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 would > have to > loop over all base types in valops.c as well. I am not sure whether ther= e exist > other > languages that allow this kind of access though.. If not it might be a bi= t 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 Silva > 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