From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YB98LD/8OmIkCgAAWB0awg (envelope-from ) for ; Wed, 23 Mar 2022 06:53:51 -0400 Received: by simark.ca (Postfix, from userid 112) id B3AA91F3E2; Wed, 23 Mar 2022 06:53:51 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 E77E71EDF0 for ; Wed, 23 Mar 2022 06:53:50 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9F70A385E838 for ; Wed, 23 Mar 2022 10:53:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F70A385E838 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1648032830; bh=NLesa7uH7v5fc/1FEMhLjGCNJfUY6Ndw57vuAll+3xk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=qc7u9dLQkM0Sj+pX/tiLFcpMHNtUT9Gd5RSSRv4KRdYRISgwxyq4L8bIvKApJ9dHK GUnQYW4vR3jw0jEXm/hePanLsyTpn5NTd6AtUJMc9ZIQ6XaZdm7pj4lYfCLaxZC6gf VySBAUKKi6i3mNhXBE84JJAIUV8+hhgjC9bDdyU8= Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by sourceware.org (Postfix) with ESMTPS id 92A0A3858405 for ; Wed, 23 Mar 2022 10:53:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 92A0A3858405 X-IronPort-AV: E=McAfee;i="6200,9189,10294"; a="321277405" X-IronPort-AV: E=Sophos;i="5.90,203,1643702400"; d="scan'208";a="321277405" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2022 03:53:28 -0700 X-IronPort-AV: E=Sophos;i="5.90,203,1643702400"; d="scan'208";a="544142386" 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; 23 Mar 2022 03:53:27 -0700 To: gdb-patches@sourceware.org Subject: [RFC][PATCH 0/1] Fortran entry and DW_TAG_entry_point Date: Wed, 23 Mar 2022 11:53:18 +0100 Message-Id: <20220323105319.2894169-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 a patch that enables GDB to parse the DW_TAG_entry_point DWARF tag. It was already sent to the mailing list a while ago but got lost in review (see the commit message of the attached patch). The patch was originally written with ifort in mind, the only compiler we know of, that actually emits the DW_TAG_entry_point. It is used to describe alternative entry points to functions defined with Fortran's 'entry' keyword. With this patch it becomes possible to define and hit breakpoints in an executable that uses the 'entry' feature and has been compiled with ifort. Gfortran and ifx actually follow a different way to describe Fortran entry points. Both emit a DW_TAG_subprogram instead. Sadly, the DWARF emitted by ifort is not quite correct for the given test (or any other entry point test we tried). Some parameters of subroutines and entry points have a wrong DWARF location description. So even though hitting breakpoints is possible in the test, printing of the passed variables fails and running the test with ifort will still produce FAILs. With this in mind, we were unsure what to do with this patch, thus the RFC. On the one hand we did not want the patch to be lost. On the other hand the compiler the patch was written for has some issues in its emitted DWARF and we do not know when these issues can/will get fixed. Note, that the attached test only fully passes with gfortran. Ifx, while able to define breakpoints at entry points, also has issues producing correct DWARF for entry points (using the DW_TAG_subprogram approach). The patch was tested with the standard board, unix/-m32, navtive-gdbserver and native-extended-gdbserver and we did not find any regressions with these. Any feedback is highly welcome. Cheers! Nils Nils-Christian Kempke (1): dwarf, fortran: add support for DW_TAG_entry_point gdb/dwarf2/read.c | 101 ++++++++++++++++++++++ gdb/testsuite/gdb.fortran/entry-point.exp | 67 ++++++++++++++ gdb/testsuite/gdb.fortran/entry-point.f90 | 48 ++++++++++ 3 files changed, 216 insertions(+) create mode 100644 gdb/testsuite/gdb.fortran/entry-point.exp create mode 100644 gdb/testsuite/gdb.fortran/entry-point.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