From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by sourceware.org (Postfix) with ESMTPS id CEF073857C56 for ; Tue, 18 Jan 2022 13:26:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CEF073857C56 X-IronPort-AV: E=McAfee;i="6200,9189,10230"; a="245008562" X-IronPort-AV: E=Sophos;i="5.88,297,1635231600"; d="scan'208";a="245008562" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2022 05:26:37 -0800 X-IronPort-AV: E=Sophos;i="5.88,297,1635231600"; d="scan'208";a="517767450" 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; 18 Jan 2022 05:26:36 -0800 From: Nils-Christian Kempke To: gdb-patches@sourceware.org Subject: [PATCH 0/2] Resolve dynamic types for pointers Date: Tue, 18 Jan 2022 14:26:24 +0100 Message-Id: <20220118132626.3786176-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.6 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.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: Tue, 18 Jan 2022 13:26:41 -0000 Hi, please find attached two patches aming at improving usability, especially but not limited to Fortran and C/Cpp. The following two patches attempt to resolve dynamic properties for pointers when printing/accessing them. When printing/dereferencing pointers with dynamic target types we resolve the target type first. This enables GDB to print additional information about the type of the pointer/underlying object. For example, in C this enables the printing of the dimension of a dynamic array pointed to by an array pointer. Any comments are much appreciated! Cheers, Nils Bernhard Heckel (2): gdb/types: Resolve dynamic properties of pointer types. gdb: Resolve dynamic target types of pointers. gdb/c-valprint.c | 19 +- gdb/gdbtypes.c | 29 ++- gdb/testsuite/gdb.cp/vla-cxx.cc | 4 + gdb/testsuite/gdb.cp/vla-cxx.exp | 33 ++++ gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp | 4 +- .../gdb.fortran/pointer-to-pointer.exp | 2 +- gdb/testsuite/gdb.fortran/pointers.exp | 181 ++++++++++++++++++ gdb/testsuite/gdb.fortran/pointers.f90 | 29 +++ gdb/typeprint.c | 17 ++ gdb/valops.c | 11 ++ gdb/valprint.c | 6 - 11 files changed, 323 insertions(+), 12 deletions(-) create mode 100644 gdb/testsuite/gdb.fortran/pointers.exp -- 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