From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14839 invoked by alias); 12 Nov 2013 17:43:35 -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 14828 invoked by uid 89); 12 Nov 2013 17:43:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_20,RDNS_NONE autolearn=no version=3.3.2 X-HELO: rock.gnat.com Received: from Unknown (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 12 Nov 2013 17:43:32 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C59FA11661C; Tue, 12 Nov 2013 12:43:55 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id L7slEpXTGapA; Tue, 12 Nov 2013 12:43:55 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 79A01116590; Tue, 12 Nov 2013 12:43:54 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id B0AC0E0735; Tue, 12 Nov 2013 21:43:19 +0400 (RET) Date: Tue, 12 Nov 2013 17:48:00 -0000 From: Joel Brobecker To: Eli Zaretskii Cc: tromey@redhat.com, gdb-patches@sourceware.org Subject: Re: [RFC] New GDB/MI command "-info-gdb-mi-command" Message-ID: <20131112174319.GE3481@adacore.com> References: <8761rzknb4.fsf@fleche.redhat.com> <1384255504-28444-1-git-send-email-brobecker@adacore.com> <83siv11soi.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83siv11soi.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-11/txt/msg00319.txt.bz2 > > This patch adds a new GDB/MI command meant for graphical frontends > > trying to determine whether a given GDB/MI command exists or not. > > > > Examples: > > > > -info-gdb-mi-command unsupported-command > > ^done,command={exists="false"} > > (gdb) > > -info-gdb-mi-command symbol-list-lines > > ^done,command={exists="true"} > > (gdb) > > Sounds good to me. > > > +@subheading The @code{-info-gdb-mi-command} Command > > +@findex -info-gdb-mi-command > > This should be prominently indexed with @cindex entries, as this > command is very important, and should be easily found. > > > +@subsubheading Synopsis > > + > > +@smallexample > > + -info-gdb-mi-command CMD_NAME > > +@end smallexample > > + > > +Query support for the @sc{gdb/mi} command named @var{CMD_NAME} > > Ts-ts-ts... ASCII art habits die hard. Use @var in the example, and > don't upcase CMD_NAME (it is upcased in Info anyway, and will look > better in print in lower case). Thanks for the documentation review. I will fix them and post a new patch after we confirm the final version of the command. > > +(the leading dash (@code{-}) in the command name should be omitted). > > Is this wise? How about if we support both with and without the dash? It's just easier to program, as this is how commands are stored in GDB and also looked up by the GDB/MI commadn parser. This can be argued as weak justification, and it is, but we don't really need to do any better, IMO. Since this is a command in a mode mostly intended for machines, I didn't see the point in supporting the other version, or both. I still think the current syntax is fine as clearly documented. But I can implement the more natural one instead, if we want. I think providing two modes of operation would be overkill, though. > > +There is no corresponding @value{GDBN} command. > > Having a way of querying that in CLI would facilitate better .gdbinit > files, I think. Can you give some ideas as to how it would be used. I thought this command to be completely irrelevant to CLI, so didn't even start to consider the idea of providing it in CLI. Remember also that you can always execute a GDB/MI command from CLI using "interpreter-exec". > > +@smallexample > > +-info-gdb-mi-command symbol-list-lines > > +^done,command=@{exists="true"@} > > +@end smallexample > > Btw, why "command="? Perhaps "result="? I don't really have an opinion. I eventually selected "command" because the output describing a command, and "command" was also less generic than the first choice I made ("info"). If people think that "result=" is more MI-like, it's commpletely appropriate to make the change. Thanks! -- Joel