From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by sourceware.org (Postfix) with ESMTPS id D9F743858417 for ; Mon, 17 Jan 2022 10:28:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D9F743858417 X-IronPort-AV: E=McAfee;i="6200,9189,10229"; a="244795232" X-IronPort-AV: E=Sophos;i="5.88,295,1635231600"; d="scan'208";a="244795232" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2022 02:28:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,295,1635231600"; d="scan'208";a="531284241" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga008.jf.intel.com with ESMTP; 17 Jan 2022 02:28:08 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) 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; Mon, 17 Jan 2022 02:28:07 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 17 Jan 2022 02:28:07 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Mon, 17 Jan 2022 02:28:07 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.103) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Mon, 17 Jan 2022 02:28:07 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EdRuEF+aIT5tP5qzAV78iAYqCmCW4vgpzpZgtgs7JYWbcAljzgxO2M3PZU6hkAUZV1XTmk83uwgoEaDywBdhLB/gG7sE8NGnrLyBaOpyheKJakSj6VOzM1wLDb+++FzdhGtO685xhvdShz2B0dkmD9KFJ663XybesiJzYbMpfdOAu2sM32dsJ2wXV2afnvK6dilHJnoWIY2YHj0b6g4DmpopwuOOFInlBzEhWCdICVWlL0nKdlkszOyBfmWhNZD8x9P5E1EJ0vm0JJfw5WpUkd9HLvmq8RRfZOqnBIqHzkeAkafvYgqN4wgpTGHpnqlJV6ObwXV9ZERBVImAYm5txw== 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=En+x9ETb9AfvrskKBCxWF10WD20MM0TSp/z6r7b23Ag=; b=ZU5R1Iydzb+wO94Yf3pgakoWwGQavavH7SpkjbmIL8naklVpXQ35Ok6guCG/8+PYAis0wBOQyRKUKmObIOUM8qmJ0LVOMKjQzeMpgzkkStjLfQlF8IYxNmPvWTdYPxmjKVhNyZQO5WZmjUFDk7Gy4XDKlP1bsi1ZkR+whdKlnFKh0aO6NiWdcjXXsfohroauyMTT7tfB4+1FB54AYcyz7yRVSLtezrC1PVpTdlWwBFkwAJ+ryQ5SyM0mc5bB4ZnVGJEMPY72uuCi7ZVbP0qgDeO/jg//wOXVYQ3XFW+1W9A1794rxnfJTo9sycWD2mZhnKLdBEGjeMP1PTxjHR6zwg== 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 BYAPR11MB3288.namprd11.prod.outlook.com (2603:10b6:a03:7e::33) by SN6PR11MB3102.namprd11.prod.outlook.com (2603:10b6:805:d1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12; Mon, 17 Jan 2022 10:28:05 +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.4888.013; Mon, 17 Jan 2022 10:28:04 +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/IikOQB4yt8aER66xi80olgAP6V6A= Date: Mon, 17 Jan 2022 10:28:04 +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: <87h7a6f5fu.fsf@tromey.com> 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: ddd417e9-905e-4394-91d1-08d9d9a40bec x-ms-traffictypediagnostic: SN6PR11MB3102:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fMZQC1HnAV/JsUK1t41wP1LFxcAvvWuv/NJcVILf2wl9YYHFY1SwnfPwE+oP9MMZqpo/qEfbNdoCB9D+BTjPLM6js/TIwd54tEHxd1xZBNlQ1oEM/3L/5ihwNVM5n3L9porY+mqSnH7aitEtod53HFxJuEKVaT1FZFNxqReQ0g707uMizaurMlFZpGBkfZTp2akA4XYZU3h6zlvoIggG/mYfDULJCSAKZ8N3HIotxr1svr2cx/b3+XkfBWtKd/cXETQl2lQo5zqRtAWP/9E2DfjwrRWL+a1L/tyA0xH//HFbRMENDgLEtaGpWWJuedj4LuvW+b/6agDvd8pXf7n0Jf9EeOdG49CSny3NG6XfXwtbbkSO3plNj1XgNd+YXId/wzdfEu4xBHqOKiIJhBpoOWrZtn9EQqaMRIH37De/+pLnaRs5eLDQy7Xg1wF0HPgn0UZ+0+iudcar83hNYMSOpzSu+YKG5bn5KFOgMgSfb2zLbzl+lFJGWaA++OMX+DrUzvcn9x5QiMObCs4ILRkiFlZKRUgvBlYVTQLA9eEcGZQrbVNj/kwzf735RMMLKGMKnj4vQN+o17kd0bS9dXJZsRMnM8ri/0xf6Saf7Znw8bEatRv1/Z9UfaJ78TJGwYM0S/DkvbAMIlE+LSA2yFd5jNblrATM4IxJ9g5tjuTJT/K63Q3khoXEp1uSR/Wgj06xom46ix/xMWvPmYnJImBbsg== 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:(366004)(7696005)(6506007)(83380400001)(66946007)(8676002)(38100700002)(9686003)(33656002)(122000001)(53546011)(8936002)(76116006)(66476007)(5660300002)(66556008)(66446008)(64756008)(186003)(52536014)(2906002)(316002)(86362001)(82960400001)(38070700005)(110136005)(71200400001)(508600001)(55016003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?IUR8yDfPfDuheZh+9lK8V93FAvyu1q+gqSDYFBEAYKDMk0fQ6Dg/SJF3u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OEbzfRktseCLNitdxAKobSglCq8?= =?us-ascii?Q?qXpcTVmpvy4LrUYQ6Gh5lHJd9RQ7Sv9pcFy76QHSPdC8CSWs3bNdlw/MVoCh?= =?us-ascii?Q?Q+zN+tgXVJX/xqpA5GIV7ezxyl6IF10JGI1E6npqfdrcPk8ZupN5nS3YhSF/?= =?us-ascii?Q?0o036zsQZILvNmF89HpwdJ/KICKm7Iptl38LBJ1bLb+vJGUe2B3x8bMzicWe?= =?us-ascii?Q?3pn2xYAr5FkXguWN6dSAHUymNsGfn/TH6xQnl1rejQ+45BHjVNtVebeycBIM?= =?us-ascii?Q?QHND/hqIRqbrK8a5UQgelA0GWete1zf4FO3OY7aoeVI0WDFpR8j8fMmSF7ae?= =?us-ascii?Q?J+MG4oHmFbFPi7If/L+s39MsNL5mzp+UNqYIpfSqnkoc4atmpRyPpCZ3pAvm?= =?us-ascii?Q?T59DRkX8S3nGl0pZqa5U2eR4HKVAeadR8SbAodTmclo62AicFIcMTlaBUSIu?= =?us-ascii?Q?bkzCZrZDt6LXt+Hf4otnntRqwdXNQTZxdiRj2adD1E7Wlqft94oMqA5AXkka?= =?us-ascii?Q?7k9g4pn37ZZascJ/S5Rr+kjPKLs6bHmY0XnSj8PG2m1XciOmVJecajwJIv/q?= =?us-ascii?Q?BYsXklBbrwj0d6RYsMEsw9d/Z0qDu166u7HlSxWdApdJF3x39jebI1af/Y69?= =?us-ascii?Q?yJs1b9Df8QLUMxznmC5GdmuqBG2UeWn9nJ3frvZKJJwHxtkJkaGGB2cL/IRo?= =?us-ascii?Q?pkQTYXnPab159Y+OmdXmenRbXRMJA3r4k40CoibOjY1wO4wer2auol3iJ9kz?= =?us-ascii?Q?5ltALFPYKFKSQa3oMJ25xjjLZPs3NTVbZh7NvbM//eIAjiO47X0d/1f39Kq1?= =?us-ascii?Q?DBr4DVuwyw=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: ddd417e9-905e-4394-91d1-08d9d9a40bec X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2022 10:28:04.6928 (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: RzJbJvZKzrkj2mX5DW1M12rPa3WUQ2JNYlYL+mxBz8Z9nn6efnTdxyfQ7ixe7wsqjE00aIJwjiy1HD7KlyfimMNxVU5Hj7SEmVgxPpsUVi4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3102 X-OriginatorOrg: intel.com Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.7 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 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: Mon, 17 Jan 2022 10:28:35 -0000 Hi Tom, > -----Original Message----- > From: Tom Tromey > Sent: Friday, January 14, 2022 9:06 PM > To: Nils-Christian Kempke via Gdb-patches > 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 access 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 inhe= rited > >> + 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 leftov= er 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_e= lt 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 b= e 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 ha= ve 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 Silva = Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928