From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5629 invoked by alias); 4 Apr 2006 07:25:17 -0000 Received: (qmail 5612 invoked by uid 22791); 4 Apr 2006 07:25:16 -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, 04 Apr 2006 07:25:15 +0000 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1FQfuQ-000278-AJ for gdb-patches@sources.redhat.com; Tue, 04 Apr 2006 09:25:02 +0200 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 ; Tue, 04 Apr 2006 09:25:02 +0200 Received: from ghost by zigzag.lvk.cs.msu.su with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Apr 2006 09:25:02 +0200 To: gdb-patches@sources.redhat.com From: Vladimir Prus Subject: Re: Add -var-info-path-expression command Date: Tue, 04 Apr 2006 07:25:00 -0000 Message-ID: References: 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-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-04/txt/msg00025.txt.bz2 Any comments on this yet? I believe we've discussed the rationale for -var-info-path-expression command in the main list, and agreed that it's necessary. - Volodya > Hello, > the below patch ports the -var-info-path-expression MI command from Apple > version. It allows on get expression corresponding to any variable object, > in language-specific syntax, which can be used, for example, to set > watchpoint on that expression. > > Top-level changelog entry: > > 2006-03-17 Vladimir Prus , > port of changes on Apple branch: > 2002-03-28 James Ingham > > * varobj.c > (child_exists): Take child index, not child name, for performance. > (get_type_deref): Pass out whether the original was a pointer or > not. > (path_expr_of_variable): New function. This returns the full path > expression to a variable. The intent here is that you could use > this to make a new root varobj corresponding to the child varobj > whose path expression you are getting. > (varobj_get_path_expr): New function. External wrapper for > path_expr_of_variable. > (c_path_expr_of_child, cplus_path_expr_of_child, > java_path_expr_of_child): New functions, return the path expr of a > child in its parent. Also caches the expr for later use. > (is_root_p): New convenience function, returns whether a variable > is a root. Then I changed all the uses of var->name to use > name_of_variable, and the test > for is this a root were changed to use is_root_p. > > * varobj.h: (varobj_get_path_expr): New function definition. > > > MI changelog entry: > > 2006-03-17 Vladimir Prus , > port of changes on Apple branch: > 2002-03-28 James Ingham > > > * mi-cmds.h: Added def'n of mi_cmd_var_info_path_expression. > * mi-cmds.c: Added var-info-path-expression to command list. > * mi-cmd-var.c (mi_cmd_var_info_path_expression) New function, > the MI interface to varobj_get_path_expression.