From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23190 invoked by alias); 15 Nov 2013 12:19:33 -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 23174 invoked by uid 89); 15 Nov 2013 12:19:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,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 12:19:31 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAFCJIuN010584 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 15 Nov 2013 07:19:18 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rAFCJFgt026527; Fri, 15 Nov 2013 07:19:16 -0500 Message-ID: <52861143.3030408@redhat.com> Date: Fri, 15 Nov 2013 12:39: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> In-Reply-To: <20131115033021.GT3481@adacore.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-11/txt/msg00410.txt.bz2 On 11/15/2013 03:30 AM, Joel Brobecker wrote: >> Pedro> Just a POC. Of course, we'd have to go audit all MI "error" calls. >> >> It seems like a reasonable idea to me. > > The idea of a specific and documented error code seems much more robust > to me. > > Regarding invalid switches, we may have to extend the current proposal > to allow the command to specific what in the usage caused problem? Not sure about that. Sounds more complicated than it's worth it. > In my proposal, it was easy to extend by adding a "feature=[...]" > list to the output. Or maybe that's overkill? Or use list-features > for that instead? As list-features already exists, and works just as well, that might indeed be overkill. Or put another way, is there a use case that list-features doesn't cover, or something about "feature=[]" that'd make ours and frontend writers' lives easier? Just like with list-features, we'd always have to manually take care of listing the new command feature in "features=[]", so on our end it doesn't seem to buy anything. IOW, thinking in terms of KISS seems to suggest sticking with list-features. > I'd like us to decide to something I can go and implement. Either way, > I think we can start by concentrating with the initial goal, which is > to determine whether a command exists or not. 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. > 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. :-) -- Pedro Alves