From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by sourceware.org (Postfix) with ESMTPS id 2070C3858C60 for ; Thu, 10 Feb 2022 13:20:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2070C3858C60 X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="233048409" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="233048409" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 05:20:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="602033737" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga004.fm.intel.com with ESMTP; 10 Feb 2022 05:20:03 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 10 Feb 2022 05:20:03 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 10 Feb 2022 05:20:03 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Thu, 10 Feb 2022 05:20:03 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.176) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Thu, 10 Feb 2022 05:20:02 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ElXzUAbT23H5HKwlYKPj3wSRcCRWBYuiw4Ta7YRqQYJQ0xOTkutjaJGiFTmbq2ZWSb8zzo8xYvxBPlPPE6FW5/VZRrtIyrmbymeSeA86JbY9mQho7OUG6bp7nIwNfyZk6pQ5eIOxBJDBEDvcnZH7tkJy3wv6I6dUDM998hv2QjkK9YAjYj/EREQrl3Ak4kM51TaqBe/ChMy7SSbCGuIGR7J4wWh2UhB0Ce+dbVdRaeft4H6EMPuLxefKWq3tYDlKM6IK7ww+zfdvVyJENqtnEjEPJ4pDqwn+RgrozC8WEy//zcjpVfVIywBwKfL9L7+r/LvBBTLxMpDiQb9HCp/FhQ== 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=SEpFNJ1LdjaxHiJa8HPF+O9MdFtzvlTGxQs3I4lRI4Y=; b=PXKQNHdzCNlU33m60BZB8CHsA+YtdEjX4EGKBBfyBzRBNmyjfKt1C5fiaNI6gnHrweGccya4Iy+kFF+S4mTU6mh0nY16ljkOH1Qcnd+x9gEQzP86aj7Vr2LeJfbUYEDSUdmIGqyLzi6fB0seaaZBAOgUUVR5xyMEi6Z6r0++kF1T0O9CbIK7V1Fk2OFsGtzvwis4+WdutU/tLSRFNvHR/d0pRyoTjw1dm+wR/kjqIb21+PXALHmDhtxlbRWpT3CXl0W3+aEls9U2Mbv5dLrmTZpIqsyuuuIcjG4MGvEcEqAcI9CehDNS5Fu4hEDWaugAE8++bqKRAtN/gIf9yInD0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from CY4PR1101MB2071.namprd11.prod.outlook.com (2603:10b6:910:1a::10) by MN2PR11MB4581.namprd11.prod.outlook.com (2603:10b6:208:26c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Thu, 10 Feb 2022 13:20:01 +0000 Received: from CY4PR1101MB2071.namprd11.prod.outlook.com ([fe80::51cf:5e76:e700:11f5]) by CY4PR1101MB2071.namprd11.prod.outlook.com ([fe80::51cf:5e76:e700:11f5%7]) with mapi id 15.20.4951.019; Thu, 10 Feb 2022 13:20:00 +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/uVcIAOBwzg Date: Thu, 10 Feb 2022 13:20:00 +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: bca8a741-3959-47d7-0534-08d9ec980abe x-ms-traffictypediagnostic: MN2PR11MB4581: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: 7IUNYn9sj6efmDZ8FBmw/dXifo56MVMmmLmQ7zud86/trWC2Mc8uMQGlLsZGj41KJ9U2/e26a4vZ0ZaJ1ZQXZ9yyhgyH1jo41FMKiusiyAeUTNuYzKWpvS/ls9U2PDgEaQoIfIOXqFevZRaLznFm3Bl3T9G5vohw5zI6Aq0guoh+AGpx71kHzuFUwc4aEPOIkmDrV+wkqmLAF82YXZ8c6HLeib89WV1L9qGPbQ/eb9OGVZTpulmany/Y7RDniUsgMkxKmcwAJEdBptyDrCdQYlgiSeGZLqdWjunkqgkE8Ts07OLkzlrDhMYJlBJuv11lCv6Fl3jooWMQWwavkCvres5zw35fVhJvg1zNkmcEaeC0XZcihgfGRfopyKTIVBscm2VsE4n2lxy8Gq7w8Px0RqAx8FJ/VajrQvvy5ZlCuQhwseCUWVBetYdYzgMassTP4uHs+rt0H24cWCIEALzMnO5QrOBXiNAOcFDAvjBnOkk8a9GFy0K32gk8Zdcm4X9w+wZPJ1AxJ5XI+8yD6ih2Dp45i/klQndpp6kG+DSNO/bBp6iDuv/v2qE/8PJQzoak5krBzJUhqwDEkdY8hskPnbs98zFlARbJjhPWKz0EM5YjPtekhobenW14GCmR5l85ZF53YCrlVjCklp6ZEjMj4j7OvbsUTYF2vmJh5T4Xju3tLi0ktwj75SGGs7ZRQEM6SAt9aZVM95DVwyHVXt5Sspgr+Gkqau6YvwF2Vn4wR3P7rxlEMPwnmrrR4+1xSzDJcOPAp6dgTaAxgPE6ONjYxTwafVFWGq9H991y7NCSAYQ= 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)(66476007)(66446008)(55016003)(66946007)(110136005)(15974865002)(76116006)(82960400001)(8936002)(64756008)(122000001)(8676002)(53546011)(33656002)(9686003)(66556008)(316002)(186003)(38100700002)(5660300002)(52536014)(508600001)(71200400001)(2906002)(7696005)(6506007)(83380400001)(86362001)(38070700005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-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?7jA+ANiIDg=3D=3D?= Content-Type: 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: bca8a741-3959-47d7-0534-08d9ec980abe X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Feb 2022 13:20:00.7639 (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: 3ZIdnZy/WTOwSqKtewlqwk0WOOW80UQvK+b527W+q/gLDnTFIc8BcSs7JIXEi3ymD1fYIeSRfRi0K7TsvF+hZ5cNfgsfXq0SCPnr9xkfKg4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4581 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, 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: Thu, 10 Feb 2022 13:20:09 -0000 [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/fortran: > 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/fortra= n: > > 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 descri= bed > > > >> in the Fortran standard. > > > > > > Thanks for the patch. > > > > > > >> In doing so the patch also fixes a bug in GDB when trying to acces= s 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 an = 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 actually = 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 value > > > 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 rest= of > > valops. > > > > On more option that is also cleaner than directly checking the type mig= ht be > > to > > generalize the concept of this "member access by base name" a bit and a= dd > 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 th= ere > 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 Sil= va > > 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