From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6656 invoked by alias); 12 Aug 2009 22:38:41 -0000 Received: (qmail 6631 invoked by uid 22791); 12 Aug 2009 22:38:40 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Aug 2009 22:38:33 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7CMYVNA006342; Wed, 12 Aug 2009 18:34:31 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7CMYUNG006842; Wed, 12 Aug 2009 18:34:31 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7CMYU7H000798; Wed, 12 Aug 2009 18:34:30 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id AB3803782F7; Wed, 12 Aug 2009 16:34:29 -0600 (MDT) To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: FYI: fix PR gdb/8869 References: <200908081443.59412.pedro@codesourcery.com> <200908081717.28622.pedro@codesourcery.com> <200908081754.13861.pedro@codesourcery.com> From: Tom Tromey Reply-To: Tom Tromey Date: Wed, 12 Aug 2009 23:00:00 -0000 In-Reply-To: <200908081754.13861.pedro@codesourcery.com> (Pedro Alves's message of "Sat\, 8 Aug 2009 17\:54\:13 +0100") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2009-08/txt/msg00173.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Sorry for the delay on this. Pedro> One issue is that "set language" without an argument doesn't show that Pedro> larger help list of known languages, because the enum command machinary Pedro> takes care of handling the case of no argument itself. I've moved that Pedro> listing to "help set language", which I think is a better place for it Pedro> anyway. Yeah. If you put this in you might as well revert my cli-decode.c changes. Pedro> (add_language): Install or reinstall the "set language" command Pedro> here, and make it an enum command. Build the enumeration and the Pedro> help string from the current list of known languages. This is also ugly, IMO, though differently so. Re-registering the command means a lot of allocation for something that we could fully know at build time. I suppose it would be possible to count the languages and only call add_setshow_enum_cmd on the last call to add_language. If we are to compare ugliness (in what units? I suggest negative helens), though, I would say that yours is the less ugly. Pedro> Register the "auto" "local" and "unknown" languages in that Pedro> order. I was curious to know the rationale for this particular change. If order matters, this does not seem correct, because nothing guarantees that _initialize_language will be called before any other call to add_language. Instead the sorting would have to be done in add_language. If order does not matter, then there's no need for the change. Tom