From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14883 invoked by alias); 22 Dec 2006 06:16:05 -0000 Received: (qmail 14873 invoked by uid 22791); 22 Dec 2006 06:16:04 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 22 Dec 2006 06:16:00 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1GxdhA-0002Xs-2t for gdb-patches@sources.redhat.com; Fri, 22 Dec 2006 09:15:53 +0300 Received: from localhost ([127.0.0.1] helo=ip6-localhost) by zigzag.lvk.cs.msu.su with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.50) id 1Gxdgz-0002Xf-VO; Fri, 22 Dec 2006 09:15:42 +0300 From: Vladimir Prus To: Nick Roberts Subject: Re: RFC: MI - Detecting change of string contents with variable objects Date: Fri, 22 Dec 2006 06:16:00 -0000 User-Agent: KMail/1.9.1 Cc: gdb-patches@sources.redhat.com References: <17797.65268.689590.797944@kahikatea.snap.net.nz> <17803.2404.969452.883622@kahikatea.snap.net.nz> In-Reply-To: <17803.2404.969452.883622@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200612220915.34288.ghost@cs.msu.su> 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 X-SW-Source: 2006-12/txt/msg00299.txt.bz2 On Friday 22 December 2006 01:23, Nick Roberts wrote: > > Why do you need the value_get_print_value function? I think that the right > > semantic of -var-update is that it returns all such variable objects for > > which the -var-evaluate-expression will return different value before and > > after -var-update. -var-evaluate-expression is the only way to get a value > > of varobj, so we should be using that, not some similar but different > > function. > > > > In order words, why can't you just call varobj_get_value instead of > > introducing and calling a new function? > > Because -var-evaluate-expression uses varobj_get_value so they will always > return the same value? Then, there are two solutions: 1. Make c_value_of_variable and friends accept struct value as opposed to taking struct varobj. 2. Extra the part of c_value_of_variable that you've based your function on into a separate function. Make both c_value_of_variable and install_new_value call the new function. I'm not sure which approach you find better, but I don't think copy-pasting is a solution to anything. - Volodya