From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ihgpJ8GozmJh9xEAWB0awg (envelope-from ) for ; Wed, 13 Jul 2022 07:13:05 -0400 Received: by simark.ca (Postfix, from userid 112) id 9006A1E5EA; Wed, 13 Jul 2022 07:13:05 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=ERf6AX4j; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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.6 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 BC5EC1E21F for ; Wed, 13 Jul 2022 07:13:04 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C73FC38768A3 for ; Wed, 13 Jul 2022 11:13:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C73FC38768A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1657710783; bh=8XQ/VEE6jDGiGqAF5jck9a8TpBA/FN0w03HdQX9EaGc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=ERf6AX4jlIkGWdjWf5XpWVI6PzjSOvYMAZC+6M7xaBRB+1tkH027are52oHwQD7HH xiYJ2lA7NnaodstveRW3vFLkvfg9ZW3yLsGs/g8HlLEzLshfNpgqu/t+g3oxiIkqyf mRORHAxSQyGdPJM6uOrwNL5EHZ508JRwaJXFTEb8= Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by sourceware.org (Postfix) with ESMTPS id 26A613857836 for ; Wed, 13 Jul 2022 11:12:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 26A613857836 X-IronPort-AV: E=McAfee;i="6400,9594,10406"; a="285206913" X-IronPort-AV: E=Sophos;i="5.92,267,1650956400"; d="scan'208";a="285206913" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2022 04:12:41 -0700 X-IronPort-AV: E=Sophos;i="5.92,267,1650956400"; d="scan'208";a="922591673" Received: from labpcdell3650-003.iul.intel.com (HELO localhost) ([172.28.49.87]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2022 04:12:40 -0700 To: gdb-patches@sourceware.org Subject: [PATCH v4 0/3] Fortran entry and DW_TAG_entry_point Date: Wed, 13 Jul 2022 13:12:23 +0200 Message-Id: <20220713111226.2693410-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 Cc: jinisusan.george@amd.com, tom@tromey.com, aburgess@redhat.com Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, please find attached version 4 of this series. Changes from v3 mainly try to incorporate Andrew's comments here: https://sourceware.org/pipermail/gdb-patches/2022-July/190630.html Changes since v3: * Patch 1 and 2 were introduced in order to not clutter patch 3 too much. * Patch 1 was introduced because of some code duplication in v3. It outsources some code from dwarf2_get_pc_bounds into a separate function to make the addition of the entry point handling easier. It should not contain any functional changes. * Patch 2 was introduced because, as Andrew noted correctly, dwarf2_get_pc_bounds was unconditionally writing to some pointer without checking it being non-null, an error I had replicated in my own patch. I found it appropriate to make a separate patch for this change. The assert should only trigger when we are attempting to dereference a nullptr - which should have killed GDB anyway. * Patch 3 still contains the addition of the DW_TAG_entry_point. I rebased it on patch 1 and 2. It relies heavily on patch 1 and its refactoring. It contains all leftover fixes for Andrew's comments. Most importantly it now applies GNU coding style in the example and I changed '__asm__' to 'asm'. I also added the missing use of int_size in dw2-entry-points.exp. v1 can be found here: https://sourceware.org/pipermail/gdb-patches/2022-March/186900.html v2 can be found here: https://sourceware.org/pipermail/gdb-patches/2022-April/187853.html v3 can be found here: https://sourceware.org/pipermail/gdb-patches/2022-July/190556.html This was tested against regressions on Ubuntu 20 x86_64 with the boards unix, unix/-m32, native-gdbserver, and native-extended-gdbserver. Thanks, Nils Nils-Christian Kempke (3): gdb, dwarf: move part of dwarf2_get_pc_bounds into separate function gdb, dwarf: add assert to dwarf2_get_pc_bounds dwarf, fortran: add support for DW_TAG_entry_point gdb/dwarf2/abbrev.c | 1 + gdb/dwarf2/cooked-index.h | 3 +- gdb/dwarf2/index-write.c | 3 +- gdb/dwarf2/read.c | 132 +++++++++-- gdb/testsuite/gdb.dwarf2/dw2-entry-points.c | 43 ++++ gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp | 215 ++++++++++++++++++ gdb/testsuite/gdb.fortran/entry-point.exp | 84 +++++++ gdb/testsuite/gdb.fortran/entry-point.f90 | 67 ++++++ 8 files changed, 524 insertions(+), 24 deletions(-) create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-entry-points.c create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp 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