From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15250 invoked by alias); 15 Nov 2006 14:58:57 -0000 Received: (qmail 15239 invoked by uid 22791); 15 Nov 2006 14:58:57 -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; Wed, 15 Nov 2006 14:58:43 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GkMDi-0000UW-Pm for gdb@sources.redhat.com; Wed, 15 Nov 2006 15:58:35 +0100 Received: from 73-198.umostel.ru ([82.179.73.198]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Nov 2006 15:58:34 +0100 Received: from ghost by 73-198.umostel.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Nov 2006 15:58:34 +0100 To: gdb@sources.redhat.com From: Vladimir Prus Subject: Re: MI and anonymous unions Date: Wed, 15 Nov 2006 14:58:00 -0000 Message-ID: References: <200611151238.16778.vladimir@codesourcery.com> <20061115145405.GA25212@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.2 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-11/txt/msg00098.txt.bz2 Daniel Jacobowitz wrote: > On Wed, Nov 15, 2006 at 12:38:16PM +0300, Vladimir Prus wrote: >> Traversing it with MI eventually gives: >> >> -var-list-children V.public >> ^done,numchild="1",children=[child={name="V.public.",exp="",numchild="1", >> type="union {...}"}] >> (gdb) >> -var-list-children V.public. >> ^done,numchild="1",children=[ >> child={name="V.public..public",exp="public",numchild="2"}] >> (gdb) >> -var-list-children V.public..public >> ..... >> >> Although this kinda works, I'm pretty sure UI won't be happy about empty >> expression for a variable object, and if you have two anonymous unions, >> you can't even address them. > > I'm not sure what to do for the empty expression. There's nothing we > can put there which would act like a named union, since you need one > less period - hmm, we were just discussing an MI command to recreate > expressions the other day... > > How do people use the exp="" result? Should it be ""? KDevelop uses it to construct the full expression, which will obviously break. I'm not sure about Eclipse, I think it does the same. But given that there's no way to put anything there that can be used to recreate expression, I don't see much difference. "" would work better if this is to be shown in some UI, I think. >> How about using some unique identifier for variable objects corresponding >> for anonymous unions? Say "@N"? > > That sounds reasonable. Ok. - Volodya