From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id JuHIKs5V4GGxSAAAWB0awg (envelope-from ) for ; Thu, 13 Jan 2022 11:39:42 -0500 Received: by simark.ca (Postfix, from userid 112) id 9D44F1F34E; Thu, 13 Jan 2022 11:39:42 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E93E81ECEB for ; Thu, 13 Jan 2022 11:39:41 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0026F3857439 for ; Thu, 13 Jan 2022 16:39:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0026F3857439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1642091981; bh=KTaMtEZLcuNanKHtF1fyXBvwIbGAX/gnaiydUeA+kOM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=A+jEDtJeWGJXbyVAkswB/+OVcwemBqsWT2hk0/KAjO04F8lPbdPCSawuA7G3RQBlO rzekLNiykhOpcAQwkJLNOiTMdHw22/NTBFeYvkd3iv0mg/bgWNnwM6Y92XBzSgvjiT 676CAOdw4xlvw8mmia2o2ZLbv4oKl4Fwrg+NKiM0= 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 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-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: , From: Nils-Christian Kempke via Gdb-patches Reply-To: Nils-Christian Kempke Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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