From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2565 invoked by alias); 15 Nov 2013 14:38:59 -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 2520 invoked by uid 89); 15 Nov 2013 14:38:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_40,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Nov 2013 14:38:57 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAFEciUC004812 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 15 Nov 2013 09:38:45 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rAFEcgoK029876; Fri, 15 Nov 2013 09:38:43 -0500 Message-ID: <528631F2.40408@redhat.com> Date: Fri, 15 Nov 2013 14:40:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Joel Brobecker CC: Tom Tromey , =?ISO-8859-1?Q?Andr=E9_P=F6nitz?= , gdb-patches@sourceware.org Subject: Re: [RFC] New GDB/MI command "-info-gdb-mi-command" References: <8761rzknb4.fsf@fleche.redhat.com> <1384255504-28444-1-git-send-email-brobecker@adacore.com> <20131112205229.GA7068@klara.mpi.htwm.de> <20131113021514.GG3481@adacore.com> <52851A04.6040004@redhat.com> <52851E57.30103@redhat.com> <87iovuwx7l.fsf@fleche.redhat.com> <20131115033021.GT3481@adacore.com> <52861143.3030408@redhat.com> <20131115123905.GW3481@adacore.com> In-Reply-To: <20131115123905.GW3481@adacore.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-11/txt/msg00412.txt.bz2 On 11/15/2013 12:39 PM, Joel Brobecker wrote: >> Yeah. I have no problem with your proposal. There's actually one >> case where it works, and '^error,code="unknown-command"' does not, >> which is when a command works and has effects without options. In such >> cases, you can't probe for the command's existence without causing >> the (side) effects. > > I think the intent was not to provide a probing mechanism, but > rather to provide an approach where the FE just fires the command > when it needs to, and then fallback on a CLI-based approach if > detecting an 'unknown-command' error. Yeah. Just thinking about how we'd cover all bases if we took only one approach. > But, on the other hand, I am thinking that some FEs might still > want to probe ahead of time, for instance if they do not wish to > provide a fallback mechanism (thus disabling the relevant parts > of the GUI ahead of time); Right, that's the reasoning I usually throw around too. It's the same reasoning we probe things in the RSP upfront with qSupported. I now notice that the -list-features docu doesn't talk about that explicitly, but it could be nice to suggest it. > or even if it is easier programatically > for them to probe, instead of having to handle this specific error. >>> People seem to have reacted >>> more positively to the idea of try-and-fallback approach, shall we go >>> with Pedro's idea (without the "invalid switch"/"usage" part)? >> >> If I had infinite time, I'd go for all of the above. Command to >> probe existence of commands, and make ^error indicate both >> unknown command, and bad usage. :-) > > I don't have infinite amount of time, but the first 2 (new GDB/MI > command and new ^error for unknown commands) are fairly small tasks, > so I'm happy sending patches for both. That way, we get the best > of both worlds, without must cost, I think, in terms of extra > maintenance, since both patches would be pretty small, and localized. That sounds good to me. > For invalid usage, I could add that to my list, but that'll have > to be next year... (/me wishes I would say that on Dec 31st...) :-) -- Pedro Alves