From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22913 invoked by alias); 17 Nov 2006 18:12:55 -0000 Received: (qmail 22905 invoked by uid 22791); 17 Nov 2006 18:12:54 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Fri, 17 Nov 2006 18:12:49 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1Gl8Ck-0001ni-V4; Fri, 17 Nov 2006 13:12:47 -0500 Date: Fri, 17 Nov 2006 18:12:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb-patches@sources.redhat.com Subject: Re: Variable objects laziness Message-ID: <20061117181246.GB6133@nevyn.them.org> Mail-Followup-To: Vladimir Prus , gdb-patches@sources.redhat.com References: <200611141643.25053.vladimir@codesourcery.com> <20275.192.87.1.22.1163760030.squirrel@webmail.xs4all.nl> <200611171344.54155.vladimir@codesourcery.com> <20061117142230.GA29258@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-11/txt/msg00179.txt.bz2 On Fri, Nov 17, 2006 at 08:17:04PM +0300, Vladimir Prus wrote: > - if (gdb_evaluate_expression (var->root->exp, &var->value)) > + if (gdb_evaluate_expression (var->root->exp, &value)) > { > /* no error */ > - if (value_lazy (var->value)) > - gdb_value_fetch_lazy (var->value); > } > else > - var->value = evaluate_type (var->root->exp); > + value = evaluate_type (var->root->exp); Noticed while working on another patch: can you kill the empty braces here, please (by negating the if/dropping the else). > + /* Need to coerce the input. We want to check if the > + value of the variable object will be different > + after assignment, and the first thing value_assign > + does is coercing the input. "is coerce" > + For example, it means that if assigning array to > + a pointer variable, we'll be comparing pointer with array's > + address, not pointer with array's content. */ For example, if we are assigning an array to a pointer variable we should compare the pointer with the the array's address, not with the array's content. > + /* The new value may be lazy. gdb_value_assign, or Two spaces after period please. > + rather value_contents, will take care of this. > + It might throw, but unlike var-update for -var-assign > + there's just one variable we're working it, so we don't > + need to catch the exception here. */ Wait, what? gdb_value_assign will never throw. value_contents might, but gdb_value_assign will catch it. > + Return 1 if so, and 0 is the values are equal. */ if, not is. > + /* We must always keep the new value, since children depend on it. */ Two spaces after periods please. -- Daniel Jacobowitz CodeSourcery