From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16308 invoked by alias); 27 Nov 2006 06:32:42 -0000 Received: (qmail 16298 invoked by uid 22791); 27 Nov 2006 06:32:41 -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; Mon, 27 Nov 2006 06:32:35 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Goa2Z-0003cK-IJ for gdb-patches@sources.redhat.com; Mon, 27 Nov 2006 07:32:31 +0100 Received: from 194.154.66.112 ([194.154.66.112]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Nov 2006 07:32:31 +0100 Received: from ghost by 194.154.66.112 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Nov 2006 07:32:31 +0100 To: gdb-patches@sources.redhat.com From: Vladimir Prus Subject: Re: Language of registers Date: Mon, 27 Nov 2006 06:32:00 -0000 Message-ID: References: <17770.13228.627008.188019@kahikatea.snap.net.nz> 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-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-11/txt/msg00293.txt.bz2 Nick Roberts wrote: > >> At the moment, MI varobj assume that register values have a language. As >> result, if you try to look at values of $xmm1 in a C++ program, you'll >> find that this registers has a 'public' field -- which is not reasonable. > >> The attached patch causes MI to always force the C language for register >> values, so no special processing takes place. OK? > > Experimenting with register names as variable objects: > > With C: > > -var-create - * $xmm1 > ^done,name="var1",numchild="7",type="builtin_type_vec128i" > (gdb) > -var-list-children var1 > &"Attempt to take address of value not located in memory.\n" > ^error,msg="Attempt to take address of value not located in memory." > > > With C++ > > -var-create - * $xmm1 > ^done,name="var1",numchild="1",type="builtin_type_vec128i" > (gdb) > -var-list-children var1 > Segmentation fault (core dumped) What gdb is this? Both work fine for me with mainline. > but there are already MI commands for registers. Notably > > -data-list-register-values > > and > > -data-list-changed-registers which is a bit like var-update. > > > What advantage do variable objects offer for register names? To begin with -- consistenly. There is no fundamental difference between ordinary values and registers. The frontend knows how to display the hierarchy of variable objects, and there's no need to force the frontend to have additional logic for register. Note that Eclipse, for example, does create variable objects for all registers at the moment. The second advantage is that -data-list-register-values has no hierarchy at all. If you try -data-list-register-values xmm1 then gdb print print half-screen of output that should be specially parsed and displayed. When using variable objects, the frontend already has the parsing/display code. - Volodya > >