From patchwork Wed Oct 5 20:40:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kempke, Nils-Christian" X-Patchwork-Id: 55183 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5C80C3856949 for ; Wed, 5 Oct 2022 20:41:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C80C3856949 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665002506; bh=cxWNCZ0VsK07mpQ62DbpYmvAw28Ed/8AIUUBktd9cqM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Ls3B1UpgCQnBwrUlWN7xw3uhOBb5caNcuGLkVkYIYwP3Zl+0VgbASKqvdIzSQlL2L OggDmFldHJmiNScXthiEfSY+iLiAGfy3cSpad739RV3vJ5+buHHVAO7lwCQCEidxPp +jPI1Ft3nEvpeVZLS1Zfh19hV1XsR0tu4jD5NF2I= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by sourceware.org (Postfix) with ESMTPS id B8CF63857419 for ; Wed, 5 Oct 2022 20:40:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B8CF63857419 X-IronPort-AV: E=McAfee;i="6500,9779,10491"; a="286492610" X-IronPort-AV: E=Sophos;i="5.95,161,1661842800"; d="scan'208";a="286492610" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2022 13:40:49 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10491"; a="799636715" X-IronPort-AV: E=Sophos;i="5.95,161,1661842800"; d="scan'208";a="799636715" Received: from labpcdell3650-003.iul.intel.com (HELO localhost) ([172.28.49.87]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2022 13:40:48 -0700 To: gdb-patches@sourceware.org Subject: [PATCH v2 0/4] Dynamic properties of pointers Date: Wed, 5 Oct 2022 22:40:35 +0200 Message-Id: <20221005204039.575255-1-nils-christian.kempke@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_NONE, 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-Patchwork-Original-From: Nils-Christian Kempke via Gdb-patches From: "Kempke, Nils-Christian" Reply-To: Nils-Christian Kempke Cc: simark@simark.ca Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Hi! Please find attached v2 of this series. The main change is patch 3 which became a 'some compiler DWARF that is wrong but we still want to support it' patch after a discussion in https://sourceware.org/pipermail/gdb-patches/2022-September/192159.html and thanks to Simon and Zoran. They convinced me that my v1 was wrong. V1 can be found here: https://sourceware.org/pipermail/gdb-patches/2022-September/191934.html Changes since v1: * Patch 1 is unchanged and was already approved by Simon in v1. * Patch 2: Patch 2 changed quite a bit ang mainly got simpler. Initially I thought here that DW_TAG_pointer_type could actually have the DW_AT_associated attribute, but it turned out that this again was an icc/icpc/ifort DWARF peculiarity. The part handling this attribute for dynamic pointer types got moved to patch 3. As a result, I could use the same handling for resolving dynamic pointers and references in resolve_dynamic_type_internal which made the patch simpler. I fixed the Simons' leftover comments in https://sourceware.org/pipermail/gdb-patches/2022-September/192142.html * Patch 3: From patch 2 the DW_AT_associated handling moved to this patch. Additionally, I wrapped all changed in this patch in compiler guards checking for icc/icpc/ifort and added a dwarf2 tests more concretely describing the poor Intel classic compiler DWARF we want to support here. Last, I rewrote the commit message and added some comments. * Patch 4: Added a comment to the loop in the testcase. I am not sure whether I did patch 3 the 'normal/usual' way compiler quirks are implemented in GDB. Have a look! I'm looking forward to comments. Cheers! Nils Bernhard Heckel (1): gdb/types: Resolve pointer types dynamically Nils-Christian Kempke (3): gdb, testsuite: handle icc and icpc deprecated remarks gdb, typeprint: workaround icc/icpc/ifort pointer/reference DWARF gdb/fortran: Fix sizeof intrinsic for Fortran gdb/eval.c | 3 + gdb/gdbtypes.c | 86 ++++++++- gdb/gdbtypes.h | 5 + gdb/testsuite/gdb.cp/vla-cxx.cc | 4 + gdb/testsuite/gdb.cp/vla-cxx.exp | 31 ++++ gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp | 16 +- .../icc-ifort-pointers-and-references.c | 37 ++++ .../icc-ifort-pointers-and-references.exp | 150 +++++++++++++++ .../gdb.fortran/pointer-to-pointer.exp | 2 +- gdb/testsuite/gdb.fortran/pointers.exp | 172 ++++++++++++++++++ gdb/testsuite/gdb.fortran/pointers.f90 | 29 +++ gdb/testsuite/gdb.fortran/sizeof.exp | 115 ++++++++++++ gdb/testsuite/gdb.fortran/sizeof.f90 | 108 +++++++++++ gdb/testsuite/lib/gdb.exp | 18 ++ gdb/valprint.c | 40 +++- 15 files changed, 796 insertions(+), 20 deletions(-) create mode 100644 gdb/testsuite/gdb.dwarf2/icc-ifort-pointers-and-references.c create mode 100644 gdb/testsuite/gdb.dwarf2/icc-ifort-pointers-and-references.exp create mode 100644 gdb/testsuite/gdb.fortran/pointers.exp create mode 100644 gdb/testsuite/gdb.fortran/sizeof.exp create mode 100644 gdb/testsuite/gdb.fortran/sizeof.f90