From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26840 invoked by alias); 3 Sep 2015 07:27: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 26830 invoked by uid 89); 3 Sep 2015 07:27:07 -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; Thu, 03 Sep 2015 07:27:06 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 6935B28F4257; Thu, 3 Sep 2015 09:27:03 +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 H5AaO1br_oea; Thu, 3 Sep 2015 09:27:03 +0200 (CEST) Received: from [192.168.0.53] (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 522F028F424C; Thu, 3 Sep 2015 09:27:03 +0200 (CEST) Subject: Re: [PATCH] [Ada] Fix handling of array renamings To: Joel Brobecker References: <1441178473-18654-1-git-send-email-derodat@adacore.com> <20150902235954.GC3356@adacore.com> Cc: gdb-patches@sourceware.org From: Pierre-Marie de Rodat Message-ID: <55E7F647.3030700@adacore.com> Date: Thu, 03 Sep 2015 07:27:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150902235954.GC3356@adacore.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00050.txt.bz2 On 09/03/2015 01:59 AM, Joel Brobecker wrote: > Generally speaking, we try very hard to avoid dereferencing objects, > especially arrays or structs, as this opens the door for accidently > fetching the entire object in situations where only one element was > needed. Since we are dealing with array subscripting, this is > necessarily the case here. I guess you are referring to the call to coerce_ref my patch introduces. My understanding was that this does not actually fetch the data but instead creates a lazy value (see the call to value_at_lazy in value.c:coerce_ref) from the reference "pointer", hence not fetching any data beyond maybe the reference "pointer" itself. > Perhaps the object's lifetime is constrained and thus currently would > never trigger that excessive fetch. Hm... I don't understand: about what object are you talking? The struct value * in GDB? Why does its lifetime influences whether it is fetched? > But I need to look at the rest of the code in that function more > carefully to assess it, and I am too short on time now to do it. > > I'll review again when I get back... Sure, there's no hurry. :-) Thank you for reviewing, Joel! -- Pierre-Marie de Rodat