From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32267 invoked by alias); 26 Jul 2012 15:41:19 -0000 Received: (qmail 32252 invoked by uid 22791); 26 Jul 2012 15:41:17 -0000 X-SWARE-Spam-Status: No, hits=-7.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Jul 2012 15:40:48 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6QFehCv008372 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 26 Jul 2012 11:40:43 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6QFegle017297; Thu, 26 Jul 2012 11:40:42 -0400 Message-ID: <501164F9.3020104@redhat.com> Date: Thu, 26 Jul 2012 15:41:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Tom Tromey CC: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH 4/6] new add_setshow_enum_cmd_with_notif and scheduler-locking. References: <1343146252-22558-1-git-send-email-yao@codesourcery.com> <1343146252-22558-5-git-send-email-yao@codesourcery.com> <87lii8nasx.fsf@fleche.redhat.com> In-Reply-To: <87lii8nasx.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2012-07/txt/msg00622.txt.bz2 On 07/24/2012 09:50 PM, Tom Tromey wrote: >>>>>> "Yao" == Yao Qi writes: > > Yao> 2012-07-23 Yao Qi > Yao> * cli/cli-decode.c (add_setshow_enum_cmd_with_notif): New. > Yao> * command.h: Declare. > Yao> * infrun.c (_initialize_infrun): Call > Yao> add_setshow_enum_cmd_with_notif. > > This part seems fine, though of course pending on the earlier patch and > discussion about the overall approach. > > I wish there were a nice way to do without yet another > command-registration function. We already have a dizzying variety. I can think of one way. Do it like deprecate_cmd (and I think we have other examples, but I'm not finding them now) -- make add_setshow_enum_cmd return the command handle, and add a set_cmd_wants_notif or something function that takes the command handle as argument, and sets the boolean. IOW, the code that installs the command would do c = add_setshow_enum_cmd(...); set_cmd_wants_notif (c); -- Pedro Alves