From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13532 invoked by alias); 26 Nov 2013 16:28:26 -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 13516 invoked by uid 89); 26 Nov 2013 16:28:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_40,RDNS_NONE,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Nov 2013 16:28:23 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAQGSE19028066 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 26 Nov 2013 11:28:15 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rAQGSCjp031266; Tue, 26 Nov 2013 11:28:13 -0500 Message-ID: <5294CC1C.5060701@redhat.com> Date: Tue, 26 Nov 2013 16:38:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Andrew Burgess CC: gdb-patches@sourceware.org Subject: Re: [PATCH 03/12] Mark optimized out values as non-lazy. References: <5208D1DF.1090201@broadcom.com> <5208D317.2050502@broadcom.com> In-Reply-To: <5208D317.2050502@broadcom.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-11/txt/msg00821.txt.bz2 On 08/12/2013 01:20 PM, Andrew Burgess wrote: > This is a re-posting of this patch: > http://sourceware.org/ml/gdb-patches/2013-07/msg00058.html > > The patch was never rejected, it just ran out of steam. Pedro noticed > that we could go beyond this patch and do more, even releasing the > value contents when we spot values are fully optimized out. I agree, > but believe that is a separate idea, that can always be added later, > for this case we've not even allocated any value contents yet. > > OK to apply? OK. I've pushed it (with you as author), with the commit log below. Thanks. ----------- From: Andrew Burgess Mark entirely optimized out value as non-lazy. If a value is entirely optimized out, then there's nothing for value_fetch_lazy to fetch. Sequences like: if (value_lazy (retval)) value_fetch_lazy (retval); End up allocating the value contents buffer, wasting memory, for no use. gdb/ChangeLog 2013-11-26 Andrew Burgess * value.c (allocate_optimized_out_value): Mark value as non-lazy. --- gdb/ChangeLog | 4 ++++ gdb/value.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7e28436..c144565 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2013-11-26 Andrew Burgess + + * value.c (allocate_optimized_out_value): Mark value as non-lazy. + 2013-11-26 Tom Tromey * dwarf2-frame.c (dwarf2_frame_cache): Revert patch from diff --git a/gdb/value.c b/gdb/value.c index da7778f..8052f52 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -768,7 +768,7 @@ allocate_optimized_out_value (struct type *type) struct value *retval = allocate_value_lazy (type); set_value_optimized_out (retval, 1); - + set_value_lazy (retval, 0); return retval; }