From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1234 invoked by alias); 5 May 2006 18:11:16 -0000 Received: (qmail 1226 invoked by uid 22791); 5 May 2006 18:11:16 -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, 05 May 2006 18:11:14 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1Fc4lj-0000W0-Qo; Fri, 05 May 2006 14:11:11 -0400 Date: Fri, 05 May 2006 18:11:00 -0000 From: Daniel Jacobowitz To: Nick Roberts Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH]: MI -var-set-format Message-ID: <20060505181111.GI31029@nevyn.them.org> Mail-Followup-To: Nick Roberts , gdb-patches@sources.redhat.com References: <17494.64020.26176.277202@farnswood.snap.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17494.64020.26176.277202@farnswood.snap.net.nz> User-Agent: Mutt/1.5.8i 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-05/txt/msg00075.txt.bz2 On Tue, May 02, 2006 at 06:20:04PM +1200, Nick Roberts wrote: > > Currently: > > -var-evaluate-expression var1 > ^done,value="18" > > -var-set-format var1 hexadecimal > ^done,format="hexadecimal" > > -var-set-format just repeats the format that has been set which is not > very useful since presumably the front end sent it in the first place. > > I would like to add the value in the (new) current format, which I find > much more useful: > > -var-set-format var1 hexadecimal > ^done,format="hexadecimal",value="0x12" > > OK to apply if I update the testsuite accordingly? This seems reasonable; I doubt anyone will object. I was wondering how to handle potential error conditions. I see at least two: - The return of varobj_get_value can be NULL. You should check for that. - common_val_print might fail to transform the struct value * into a string for some reason. I believe it may call error() if that happens. Should -var-set-format fail in those cases, or should it omit the value, or should it supply a default value string (e.g. )? It will have changed the varobj's settings, so I don't think ^error is appropriate. -- Daniel Jacobowitz CodeSourcery