From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by sourceware.org (Postfix) with ESMTPS id 45D0F385800A for ; Thu, 13 Jan 2022 16:39:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 45D0F385800A X-IronPort-AV: E=McAfee;i="6200,9189,10225"; a="243845939" X-IronPort-AV: E=Sophos;i="5.88,286,1635231600"; d="scan'208";a="243845939" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2022 08:39:18 -0800 X-IronPort-AV: E=Sophos;i="5.88,286,1635231600"; d="scan'208";a="515992670" Received: from labpcdell3650-003.iul.intel.com (HELO localhost) ([172.28.49.87]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2022 08:39:17 -0800 From: Nils-Christian Kempke To: gdb-patches@sourceware.org Subject: [PATCH 0/2][PR fortran/26373][PR fortran/22497] GDB support for Fortran extends feature Date: Thu, 13 Jan 2022 17:39:07 +0100 Message-Id: <20220113163909.2880018-1-nils-christian.kempke@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 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 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, 13 Jan 2022 16:39:22 -0000 Hi, please find attached 2 patches enabling GDB to deal with the Fortran 2003 feature of type extension. For ifx and ifort this patch addresses the above mentioned Bugzilla bugs fully. For gfortran (and flang - these are all I tried) the bugs still somewhat exist but I'd not consider them to be on GDB side. The problem when using gfortran (or flang) is, that the compilers do not emit the respective DWARF tag for inheritance when the extends feature is used. Thus, GDB has no chance of actually knowing about it. Assume the following scenario: type :: a real :: a_real end type a type, extends(a) :: b end type b Now if we have type(b) :: obj and compiled with gfortran or flang GDB is not able to directly resolve a member access of the sort (gdb) obj%a_real There is no member named a_real. since gfortran will not emit the DW_TAG_inheritance for b. There is a gcc bug gcc/49475 filed for this which is set as kfail in the respective test in [PATCH (1/2)]. Any feedback is welcome! Cheers, Nils Bernhard Heckel (2): gdb/fortran: add support for accessing fields of extended types gdb/fortran: print fortran extended types with ptype gdb/f-exp.y | 7 +- gdb/f-lang.h | 11 + gdb/f-typeprint.c | 24 ++- gdb/testsuite/gdb.fortran/oop_extend_type.exp | 190 ++++++++++++++++++ gdb/testsuite/gdb.fortran/oop_extend_type.f90 | 69 +++++++ gdb/valops.c | 6 + 6 files changed, 303 insertions(+), 4 deletions(-) create mode 100755 gdb/testsuite/gdb.fortran/oop_extend_type.exp create mode 100755 gdb/testsuite/gdb.fortran/oop_extend_type.f90 -- 2.25.1 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