From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22341 invoked by alias); 24 Apr 2014 20:02:03 -0000 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 Received: (qmail 22325 invoked by uid 89); 24 Apr 2014 20:02:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 24 Apr 2014 20:02:01 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s3OK1wJS032677 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 24 Apr 2014 16:01:58 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s3OK1v1R014215 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 24 Apr 2014 16:01:58 -0400 Message-ID: <53596DB5.9070803@redhat.com> Date: Thu, 24 Apr 2014 20:02:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH 07/12] MI option --available-children-only References: <1392367471-13527-1-git-send-email-yao@codesourcery.com> <1392367471-13527-8-git-send-email-yao@codesourcery.com> In-Reply-To: <1392367471-13527-8-git-send-email-yao@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00508.txt.bz2 On 02/14/2014 12:44 AM, Yao Qi wrote: > This patch adds option --available-children-only to three MI commands, > parse it, and set corresponding field of 'struct varobj_dynamic'. > > V2: > - Document varobj_set_available_children_only. > - Return "available-children-only" from "-list-features". > > gdb: > > 2014-02-14 Pedro Alves > Yao Qi > > * mi/mi-cmd-var.c (mi_cmd_var_create): Use mi_getopt to parse > options. Handle "--available-children-only". > (mi_cmd_var_info_num_children): Likewise. > (mi_cmd_var_list_children): Likewise. > * mi/mi-main.c (mi_cmd_list_features): Add > "available-children-only". > * varobj.c (struct varobj_dynamic) : > New. > (new_variable, new_root_variable): Update declaration. > (varobj_is_dynamic_p): Return true if available-children-only > is true. > (varobj_create): Add new argument "available_children_only". > Callers update. > (varobj_get_num_children): Handle "available_children_only" > (varobj_set_available_children_only): New function. > (varobj_list_children): Handle "available_children_only". > (install_new_value): Likewise. > (varobj_update): Likewise. > (new_variable): Add new argument "available_children_only". > (new_root_variable): Likewise. > (varobj_invalidate_iter): Likewise. > * varobj.h (varobj_create): Update declaration. > (varobj_set_available_children_only): Declare. In general, I think this looks good. However, I am really bothered by adding --available-children-only to -var-info-num-children and -var-list-children. When --available-children-only is passed to these commands, it permanently overrides the varobj's current property value. I don't think clients would expect that passing this flag should affect future invocations of varobj commands. I know *I* wouldn't expect that side-effect-type behavior. I think a cleaner approach would be to remove the --available-children-only option from -var-info-num-children and -var-list-children and add a new command [-var-show-available-children-only (?)] to allow the UI to flip this property if it wants to. The rest of the patch looks okay to me. Keith