From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64270 invoked by alias); 17 Apr 2015 15:29: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 64258 invoked by uid 89); 17 Apr 2015 15:29:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 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; Fri, 17 Apr 2015 15:29:58 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id E578FD3F5D; Fri, 17 Apr 2015 11:29:55 -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 IRfxQIzZytuG; Fri, 17 Apr 2015 11:29:55 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id B5062D396E; Fri, 17 Apr 2015 11:29:55 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 6040240EAD; Fri, 17 Apr 2015 08:30:04 -0700 (PDT) Date: Fri, 17 Apr 2015 15:29:00 -0000 From: Joel Brobecker To: Pierre-Marie de Rodat Cc: Yao Qi , GDB Patches Subject: Re: [PATCH] Do not consider reference types as dynamic Message-ID: <20150417153004.GL4704@adacore.com> References: <54FEDC09.3050106@adacore.com> <20150323133627.GG5438@adacore.com> <551BB1C9.10006@adacore.com> <551E5309.7090509@adacore.com> <86k2xbrpzs.fsf@gmail.com> <5530EC8C.1070308@adacore.com> <553121B2.1040406@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <553121B2.1040406@adacore.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2015-04/txt/msg00684.txt.bz2 > If the definition above is correct, then we should enhance > typeprint.c/c-typeprint.c/etc. to resolve dynamic type as type > printing goes in order to get the actual array bounds in the output. > This means: propagating a (possibly null) value in a lot of > functions and use it for type resolution when possible. I guess this > would involve a big patch but would also cover the "ptype" case. > > I guess another way to "just get things working" would be to revert > my previous patch and to enhance the dynamic property mechanism > (dwarf2loc.h) to handle reference values that are not present in > memory. For instance: extend the property_addr_info structure to > hold either the address of objects (as today) or the address of the > referenced object (for reference types). > > Thoughts? Thanks for looking into that, Pierre-Marie. My 2 cents, based on the little amount of experience we've had dealing with dyanmic types in Ada, and the amount of experience we've had dealing with the GNAT encodings, I have a feeling that it's best to maintain reference types as being non-dynamic, and enhance the functions that print reference objects instead. We should probably compare what Ada does (ada_val_print_ref) compared to C, for instance, as we handle those reference values correctly, I believe. -- Joel