From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25910 invoked by alias); 17 Mar 2006 13:20:55 -0000 Received: (qmail 25897 invoked by uid 22791); 17 Mar 2006 13:20:53 -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; Fri, 17 Mar 2006 13:20:51 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FKEsb-0000jS-Ly for gdb@sources.redhat.com; Fri, 17 Mar 2006 14:20:33 +0100 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Mar 2006 14:20:33 +0100 Received: from ghost by zigzag.lvk.cs.msu.su with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Mar 2006 14:20:33 +0100 To: gdb@sources.redhat.com From: Vladimir Prus Subject: MI: variable objects: children naming Date: Fri, 17 Mar 2006 14:56:00 -0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.8.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-03/txt/msg00123.txt.bz2 Hello! I've trying to figure out if I should use variable objects in KDevelop, and run into some issue. Assume that 'm' is a variable of type array of something. Here's a sample session: (gdb) -var-create TMP * m ^done,name="TMP",numchild="3",type="int [3]" (gdb) -var-list-children TMP ^done,numchild="3",children=[ child={name="TMP.0",exp="0",numchild="0",type="int"}, child={name="TMP.1",exp="1",numchild="0",type="int"}, child={name="TMP.2",exp="2",numchild="0",type="int"}] Suppose I display this to the user as a tree. If user selects first child of "m" and wants to set watchpoint on it, I need to know the full name of first child of "m". In C++, that would be m[0]. However, the information gdb prints does not allow me to compute m[0]: - that name is not present anywhere in the output - I can't do it myself, because I don't know that 'm' is an array, at least without manually parsing the 'type' field. - Calling '-var-info-expression TMP.0' returns: ^done,lang="C++",exp="0" It seems like Apple version has new command -var-info-path-expression, which is not present in FSF version, and which supposedly will produce "m[0]". Would it be good to port it? Any other suggestiions? - Volodya