From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2054.outbound.protection.outlook.com [40.107.244.54]) by sourceware.org (Postfix) with ESMTPS id EF7A33858D39 for ; Tue, 27 Sep 2022 09:14:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EF7A33858D39 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J1UyzjRYsySDCyb1zaO7yaDtSc9p1iILdnbLA3at9h+NBIR8ST/H5ZayX288akT/V5C2wH7jTU84yFfNax214+9+KVlCPRQprkDb1AQeF7biqNHiX+6fz1/Vz8v2/9lMECIKETD1ZYszYZTX9HyoEPiHzSPxunyQaT/lc1jqB7kkNw89LMuVctB/cRCDP1w2PwbHEyPK3MxIqrHCuybBycnF9dvvgjRzc3XDbd4RKE4L0VRSK5NFxu+pZgdgxjl2qtuQvaG2alxcR/HCN0COWDIS/2D5QjVi2iXmcTZjUD+mSeHG6/BmyVaZU5tv7keUUZEtWCtzjjgv1Ngy6HhdPg== 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=S7ydH0E1s7bA+VPRnkOVARKYEfV/w2SEXI01f+v1PZY=; b=H/ynROltg9v97MTeaQUOYwnox7wvpFzcCufXi1wJP+JhWptXYwyAs8JjmbmsSmE0yZ8s4q4TzvaCjLkmhXxU28T+AkWZlsBT3VijV147IMEPXoDwjzxAQAIqeJd/VFKvFLLN5xrev6Bne2hUpjs2Kt61POX/nZHsc2kDYPbyOlrGiU02dUl8G1VYftG3BpbqSKrfOW1q1qwVxdwWI9kUrwxRVecHfTvviekqIeSgF9NVOuziB19+8ZdI2TV42meWfI8WEwIzYGZb/8CpHehToJQFJBUQRxYkZPVrsaKdldN88fKKLlo5E525607cP496sEKrxN7+nQKuAnqmbZG6tg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none Received: from BN9PR12MB5065.namprd12.prod.outlook.com (2603:10b6:408:132::12) by IA1PR12MB6212.namprd12.prod.outlook.com (2603:10b6:208:3e4::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14; Tue, 27 Sep 2022 09:14:44 +0000 Received: from BN9PR12MB5065.namprd12.prod.outlook.com ([fe80::4fed:8ea8:aee8:577e]) by BN9PR12MB5065.namprd12.prod.outlook.com ([fe80::4fed:8ea8:aee8:577e%8]) with mapi id 15.20.5654.025; Tue, 27 Sep 2022 09:14:44 +0000 From: "Zaric, Zoran (Zare)" To: "Kempke, Nils-Christian" , Simon Marchi , "gdb-patches@sourceware.org" CC: "tom@tromey.com" Subject: RE: [PATCH 3/4] gdb, typeprint: fix pointer/reference typeprint for icc/ifort Thread-Topic: [PATCH 3/4] gdb, typeprint: fix pointer/reference typeprint for icc/ifort Thread-Index: AQHYzMJmgdDQ+xkM+kuHpF4oY9uApq3x6SSAgAAVTACAAQRjoA== Date: Tue, 27 Sep 2022 09:14:44 +0000 Message-ID: References: <20220920072629.2736207-1-nils-christian.kempke@intel.com> <20220920072629.2736207-4-nils-christian.kempke@intel.com> <4369847e-1ca8-55fa-839e-95690e28ac05@simark.ca> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2022-09-27T08:50:20Z; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=af57f2f7-56af-44ac-a1b7-1787c0fb65c8; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=1 msip_label_4342314e-0df4-4b58-84bf-38bed6170a0f_enabled: true msip_label_4342314e-0df4-4b58-84bf-38bed6170a0f_setdate: 2022-09-27T09:14:42Z msip_label_4342314e-0df4-4b58-84bf-38bed6170a0f_method: Standard msip_label_4342314e-0df4-4b58-84bf-38bed6170a0f_name: General msip_label_4342314e-0df4-4b58-84bf-38bed6170a0f_siteid: 3dd8961f-e488-4e60-8e11-a82d994e183d msip_label_4342314e-0df4-4b58-84bf-38bed6170a0f_actionid: bddfd70a-855f-4433-8604-fbecd3196454 msip_label_4342314e-0df4-4b58-84bf-38bed6170a0f_contentbits: 0 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN9PR12MB5065:EE_|IA1PR12MB6212:EE_ x-ms-office365-filtering-correlation-id: 976404b0-fda1-4de5-1702-08daa068b7a9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: iX7WymqHoNEyh95SxTQa0J8S7JYUQqXwixpkFdOFhd/nIY8HSWVhaeshV18qQDUGAac3PVUwkdL/3ujrkxwoLgDEyCQu0z85qoOgBoajZTziND7fwk0N8A3U32KzGtcpfKGIEOkD2tf3l8TbdTfMKkuhz6NKjdkajQWhO6REk1itT3ghX/02hMyA6/X1o5/JZzV8rLvb8S2dZe1+Z4nfmdzTTSBsWc0N+lw9hrBUsU4GTiV9TfQCrzfSFw13I6/GCNcNundEwMwPuJ4xpD/I9MDMZYeJXQiyDr8eN6+NnibFOIVMiUYyaaDr4ULziffKVOryXsidIrHAtZwajBdueZuZJuILswpiCLs9GdvLxTVPSmTrq3CKQNuh6CgnSSW/36O3ZRHnzIhhETP3G/LLoOI6mBgEi4BJidTlkUQWe4NhUy7jRy/WimLat4O9T6WfGCesyIHnUWdH7fDxZPe8SFdDvz0QfOfd5bN02LPzG7QRwi3b3Wd8iHFPj69WgeMoTXfMi8B9HuHIKYJH0JLovGyTqns2CD8SXhOOKmDJaawplXIvyYo1rpB51da1DZIrNlaOoNLXTVO8g2zqZzqn3INi3nlfsrcqtz9r1ekbwyxwiZcs2kvsPl9YwCh2JO93r/n3NXeHoZisll2Tp70doXpzo1wXV1FFjp3K1tc06ggPKYIlN7BmGP1Me32IOK5k4w4q5lzMVqz40SWcla9ZW4s8c6FsGyKs0dPJO4QIsiFQ0vXeVt2+Mu2NlnP0pelIUYynm3ya3M9L+Z7BTqZ9YA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR12MB5065.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(346002)(39860400002)(136003)(366004)(396003)(376002)(451199015)(55016003)(478600001)(41300700001)(110136005)(6506007)(66556008)(4326008)(86362001)(64756008)(76116006)(66446008)(71200400001)(66476007)(316002)(5660300002)(66946007)(26005)(52536014)(33656002)(8676002)(122000001)(38070700005)(9686003)(38100700002)(7696005)(186003)(2906002)(8936002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?6Yw0ZFwRNBO6l4qtZqAgOuZ1jVmmilgb5CNWGCyBe8+O16Tw6XqBSPK7M366?= =?us-ascii?Q?VKTGCEBrJOJ3A1cSi0uTwyQRp/pzegQZvLt0CqFVe6CEFJgYwwh6EDvAGDhH?= =?us-ascii?Q?mYWDrRECIUknxx4gSMkJToEO+Ai+1V7nYkpV84OOQII9vr7lo4RgdeB5JwjK?= =?us-ascii?Q?hs7sv9X3CtI/dv37ZcVkHafoTSlEDw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SHaqoRjx013PCWjIGJ0xLflFUfjHoBN4YipPKPLrgVk7EdsNq9jRaZLahWy?= =?us-ascii?Q?cUbPKPnuXqPCIVmXC6ceCdekLJ+VkbMXQVQddmO5NBEMCLbacVW5dFRK7tVG?= =?us-ascii?Q?L3taP9JLAN3R+n9al7OfUrMjcdpo4hjkovJQ+5TWb6D0FHiInBkEKlFtnUCO?= =?us-ascii?Q?4I4zt4CIqzf/UQT5O6LCnXHGXYpxYu8T2HOwRBpbQrGEt5pXcwbWXZNHXEno?= =?us-ascii?Q?i+9AdwbXTxflhhRdAoREHeQRJyFqhTfCzv+lBxdZ0FzyzqfjE2bWUkoirWku?= =?us-ascii?Q?wF0oqGfGH9GPZn2ZPPaprOn03LIC7XB9sud0TMsPAY3u9G2u27AhuIs9IWin?= =?us-ascii?Q?MoIp+Pu+uraWACxUBA6Hhv1Pe+GmlSTxRH9OYpU2XFkdQnw07Zl1rqpu3gHU?= =?us-ascii?Q?Qet6XLw2yAUM3OIx5z1Wo4TxUebGWAmU+8RVOqU3Q7I2WdAX4TdMCCjgxNnF?= =?us-ascii?Q?PcoR1KI+OUZQijfdrg4=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR12MB5065.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 976404b0-fda1-4de5-1702-08daa068b7a9 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Sep 2022 09:14:44.4388 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Lol6KXbxks1NP0lkKM0VRN+5w5DUH3I3xItr6xL+v49+hf2OFkX3MAd+tgXNtW61AVTlXT9NuJATKvLAt85nKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6212 X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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, 27 Sep 2022 09:14:49 -0000 [AMD Official Use Only - General] Hi Kempke and Simon, If you don't mind I would like to step in for a second on comment on your l= ast question: >=20 > Yes, so this part in the DWARF is also where I am quite unsure about what > the DWARF actually allows. I agree that the DWARF icc/ifort emit is a bi= t > weird. > And I also prefer the way gfortran/ifx emit Fortran/C pointers.. > And I agree that the original thought behind DW_AT_data_location was > different. >=20 > My main confusion is here: >=20 > looking at the example D.2.1, if I follow your argument, why would we the= n > use the address of arrayvar to evaluate the bounds? Would > DW_OP_push_object_address within the DW_TAG_subrange_type then not > also need to push the subrange's address (and indicate some offset to the > address of its base type, the DW_TAG_subrange_type)? >=20 > The example uses the address of 'arrayvar'. I find the example a bit > confusing and I do not clearly understand what the 'current object' is. = As we > only have a chain of DWARF DIE's I tend to assume that the innermost > variable in the chain is meant. > Everything else seems not well defined, e.g., why assume that the > DW_TAG_array_type changes the 'current object' but the > DW_TAG_subrange_type does not? >=20 The key difference here is that the DW_TAG_reference_type is a "standalone"= type and there is always an object or a member (a physical location descri= ption) behind it while the DW_TAG_subrange_type is a by definition tied to = a "standalone" array types. Unfortunately, it is not really meaningful to h= ave an object of a DW_TAG_subrange_type so the type is more there to allow = factorizing of the debug information. In the case of DW_TAG_reference_type, there is always an object that is the= reference to something and if you dereference it, you get another object t= hat the original object referenced, which is a very different case then the= DW_TAG_subrange_type and the array type that references it. That being said, I don't believe that there is anywhere in DWARF stating th= at if there is an actual object of a DW_TAG_subrange_type type that the DW_= OP_push_object_address operation (in any of the attributes of that type) sh= ould not use it, it just that the way how this type is defined doesn't real= ly allow you to have a separate object of that type. At the end of the day, the definition of DW_OP_push_object_address operatio= n just states that the operation pushes the address of the object currently= being evaluated, It even states that it could be a component of an object,= but it still has to be something tangible (a real location). I hope this clarifies things a bit for you. Regards, Zoran