From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108163 invoked by alias); 5 Jul 2016 14:35:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 108151 invoked by uid 89); 5 Jul 2016 14:35:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1149, Dynamic, news X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 05 Jul 2016 14:35:48 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9C51111694F; Tue, 5 Jul 2016 10:35:46 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xFvBJGK78Lra; Tue, 5 Jul 2016 10:35:46 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 5D311116696; Tue, 5 Jul 2016 10:35:46 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id BFCEE428F4; Tue, 5 Jul 2016 07:35:44 -0700 (PDT) Date: Tue, 05 Jul 2016 14:35:00 -0000 From: Joel Brobecker To: Bernhard Heckel Cc: qiyaoltc@gmail.com, eliz@gnu.org, gdb-patches@sourceware.org Subject: Re: [PATCH V2 3/5] Fortran: Resolve dynamic target types of pointers. Message-ID: <20160705143544.GG3295@adacore.com> References: <1467625943-21294-1-git-send-email-bernhard.heckel@intel.com> <1467625943-21294-4-git-send-email-bernhard.heckel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1467625943-21294-4-git-send-email-bernhard.heckel@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2016-07/txt/msg00067.txt.bz2 > Dynamic target types of pointers have to be resolved before > they can be further processed. If not, GDB wil show wrong > boundaries, size,... or even crash as it will access some > random memory. > > 2016-06-30 Bernhard Heckel > > gdb/Changelog: > * NEWS: Added new fortran feature. > * gdbtypes.c (resolve_dynamic_pointer_types): Resolve > dynamic target types. > * valops.c (value_ind): Throw error when pointer is > not associated. > > gdb/Testsuite/Changelog: > * gdb.fortran/pointers.f90: Add dynamic variables. > * gdb.fortran/pointers.exp: Test dynamic variables. > * gdb.fortran/print_type.exp: Test pointer to dynamic > types. I am wondering if this might be causing problems or unnecessary resolutions. For instance, at least for languages such as Ada, you don't really need to resolve the pointer type's target type when just trying to print the pointer's value. In my experience, this is the type of thing that should be done at type/value printing time, or when dereferencing the pointer (Eg. during expression evaluation). -- Joel