From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26964 invoked by alias); 18 Jan 2008 15:31:02 -0000 Received: (qmail 26947 invoked by uid 22791); 18 Jan 2008 15:31:01 -0000 X-Spam-Check-By: sourceware.org Received: from imr1.ericy.com (HELO imr1.ericy.com) (198.24.6.9) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 18 Jan 2008 15:30:39 +0000 Received: from eusrcmw750.eamcs.ericsson.se (eusrcmw750.exu.ericsson.se [138.85.77.50]) by imr1.ericy.com (8.13.1/8.13.1) with ESMTP id m0IFUb6s011058 for ; Fri, 18 Jan 2008 09:30:37 -0600 Received: from ecamlmw720.eamcs.ericsson.se ([142.133.1.72]) by eusrcmw750.eamcs.ericsson.se with Microsoft SMTPSVC(6.0.3790.1830); Fri, 18 Jan 2008 09:30:37 -0600 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: -var-update using formatted value Date: Fri, 18 Jan 2008 15:31:00 -0000 Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA2DE096@ecamlmw720.eamcs.ericsson.se> References: <6D19CA8D71C89C43A057926FE0D4ADAA04290E3C@ecamlmw720.eamcs.ericsson.se> <18320.559.863596.871051@kahikatea.snap.net.nz> From: "Marc Khouzam" To: X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-01/txt/msg00169.txt.bz2 Answering two mails: Vladimir wrote: > 1. Generally, it's best to run gdb on the same system where you run IDE, > and have it talk to remote stub on the target system.=20 You make a good point. I had started to blur the concept of GDB and target and I didn't pay attention to this anymore. Thanks for reminding me. > 2. Even if you run gdb on target, changing varobj format is very fast, > so I'm not sure caching formats is an important thing to do. Did you > actually run into a case where the performance of changing format is > unacceptable? No actual measurements. However, and I'm sorry for not letting this go, but what is the point of=20 -var-update returning the list of changed variables, if it is so efficient to go back to GDB to ask for values? var-update might as well return nothi= ng and the let the front-end ask for values again. (which is what I'll have to do if I can't cache all formats) I thought var-update told the front-end which variables changed and more importantly, which variables did -not- change, specifically so that the front-end would not need to request values that did not change. To be able to do this, the front-end must cache the value, even if it is only in a single format.=20=20=20 Why does it make sense to cache the value for one format but not for all? > Here's a possible solution: > 0. Apply my patch :-) > 1. If a user changes format, use -var-set-format + -var-evaluate-expressi= on, > and cache the value. > 2. After step, do -var-update. With my patch, this will compare the forma= tted > value (recomputed after -var-set-format) with the new formatted value.=20 > 3. If a variable is reported as changed, clear all cached formats for it. >=20 > The only case where it won't work is your example of floating variables > -- when you have float and changed the format to integer, then change of > value from 1.1 to 1.2 won't be detected. Yes the float (and string) issue remains my last problem with the cache. Even if this is a rare case, the cache must be right all the time, not most of the time :-) If not, I cannot have a cache. Nick wrote: > I don't like this change. If I change the format to hexadecimal, 11 -> 0= xb > say, the display should change, so I would like GDB to report it through > -var-update. > Previously -var-evaluate-expression was needed because values weren't > displayed when variable objects were created (-var-create now includes the > value field, -var-list-children has the --all-values option). Given that > -var-update provides a record of all changes, I'm not sure that > -var-evaluate-expression is necessary now. It is starting to come together now :-) What you are missing is for -var-set-format to have the --all-values flag. Then, I believe you can stop using -var-evaluate-expression. Using -var-up= date instead of var-evaluate-expression or -var-set-format --all-values seems ki= nd of a hack... What do you think of that? Vladimir's patch and --all-values in set-format? To me, it seems like the proper solution. Marc