From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86005 invoked by alias); 15 Sep 2015 21:19:08 -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 85993 invoked by uid 89); 15 Sep 2015 21:19:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 15 Sep 2015 21:19:07 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 975492A34313; Tue, 15 Sep 2015 23:19:04 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AUBzf8oCeIHe; Tue, 15 Sep 2015 23:19:04 +0200 (CEST) Received: from [192.168.0.6] (nat75-2-78-193-84-173.fbxo.proxad.net [78.193.84.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 81A3C2A3430B; Tue, 15 Sep 2015 23:19:04 +0200 (CEST) Subject: Re: [PATCH] [Ada] Enhance type printing for arrays with variable-sized elements To: Joel Brobecker References: <1442315486-4885-1-git-send-email-derodat@adacore.com> <20150915160611.GA20575@adacore.com> Cc: gdb-patches@sourceware.org From: Pierre-Marie de Rodat Message-ID: <55F88B48.2070007@adacore.com> Date: Tue, 15 Sep 2015 21:19:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150915160611.GA20575@adacore.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00360.txt.bz2 On 09/15/2015 06:06 PM, Joel Brobecker wrote: > This looks like an easy improvement. Thanks, Pierre-Marie! Yes it is. ;-) > I'm curious - what happens if you do: > > (gdb) print a > (gdb) ptype $ > > The concern is that $ refers to the resolved version of "A", and > that therefore we might lose the dynamic property. But I think it will > work in this case, because we do not resolve the array's element type > (each element of the actual array has to be resolved individually, > since the actual type changes from element to element). > > It's worth extending your new testcase with the above scenario as well, > I think. Huh, very interesting, thanks for raising this! Your intuition is correct: this already works for this reason. I've extended the testcase to check exactly this. > Other than that, the patch itself looks pretty good to me. The updated patch is pushed. Thank you for reviewing! -- Pierre-Marie de Rodat