From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30736 invoked by alias); 22 Jan 2008 17:50:26 -0000 Received: (qmail 30719 invoked by uid 22791); 22 Jan 2008 17:50:25 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 22 Jan 2008 17:50:05 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JHNG1-0004pP-96 for gdb-patches@sources.redhat.com; Tue, 22 Jan 2008 17:49:57 +0000 Received: from 77.246.241.246 ([77.246.241.246]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Jan 2008 17:49:57 +0000 Received: from vladimir by 77.246.241.246 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Jan 2008 17:49:57 +0000 To: gdb-patches@sources.redhat.com From: Vladimir Prus Subject: RE: [Patch] Fix for -var-update to use natural format to compare Date: Tue, 22 Jan 2008 17:50:00 -0000 Message-ID: References: <20080122150232.GA32509@caradoc.them.org> <6D19CA8D71C89C43A057926FE0D4ADAA04290E4A@ecamlmw720.eamcs.ericsson.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.5 X-IsSubscribed: yes 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: 2008-01/txt/msg00526.txt.bz2 Marc Khouzam wrote: > >> I think there are actually two different problems: >> >> 1. Given single varobj that is displayed in one format, how does one >> one if the value is "really changed". The answer here is that you don't >> get to find that -- -var-update reports only changes in displayed >> value, and since changing format is fast, nothing else is needed here. > > Ok. > >> 2. If UI wishes to show varobj in several formats, how does it >> figure out of *any* of formats has changed. There are two possible >> solutions: >> >> (a) Always keep varobj (from frontnend) in natural format, and assume >> that if natural format changes, all values possibly change. In this >> case, getting a value in different format will involve switching >> to that format and then switching back. > > That is what I will do. > If it is the best thing for GDB to make this a requirement for a frontend > that wants to show mutliple formats, may I suggest that it be added to the > documentation of var-update? A short mention that "if a frontend > wants to be notified of a change in any format, it should keep the > variable object in the natural format". It's good to improve docs in this way. It should be noted that this might not be true in future, say when we add Python scripting, or (maybe) when we'll add a way to specify floating point precision. > Also, if GDB requires this of frontends showing mutliple formats, it would > be nice to have -var-evaluate-expression take a format as an optional > parameter. Then, the frontend would not need to use -var-set-format > to get a different formatted value, and could keep the variable object > in the natural format at all times. > > I can provide a patch if this is a supported idea. I personally think this is a good idea! It means that if we for example need to quickly show some value in specific format, like hex value in tooltip, we don't need two format setting commands before and after. So, such a patch will be valuable independently of how -var-update operates. - Volodya