From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17050 invoked by alias); 12 Nov 2013 20:53:17 -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 17009 invoked by uid 89); 12 Nov 2013 20:53:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: nick.hrz.tu-chemnitz.de Received: from Unknown (HELO nick.hrz.tu-chemnitz.de) (134.109.228.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 12 Nov 2013 20:52:42 +0000 Received: from 91-65-60-135-dynip.superkabel.de ([91.65.60.135] helo=localhost) by nick.hrz.tu-chemnitz.de with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1VgKwp-0001Vf-GC; Tue, 12 Nov 2013 21:52:32 +0100 Date: Tue, 12 Nov 2013 21:17:00 -0000 From: =?iso-8859-1?Q?Andr=E9_P=F6nitz?= To: Joel Brobecker Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFC] New GDB/MI command "-info-gdb-mi-command" Message-ID: <20131112205229.GA7068@klara.mpi.htwm.de> References: <8761rzknb4.fsf@fleche.redhat.com> <1384255504-28444-1-git-send-email-brobecker@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1384255504-28444-1-git-send-email-brobecker@adacore.com> X-purgate: clean X-purgate-type: clean X-purgate-ID: 154106::1384289551-000004FB-EB70BA82/0-0/0-0 X-Scan-AV: nick.hrz.tu-chemnitz.de;2013-11-12 21:52:31;f3d036c34c479c6dfb47a64643d6fb9f X-Scan-SA: nick.hrz.tu-chemnitz.de;2013-11-12 21:52:32;8161643e877fea64c7e63adf2e6afb23 X-Spam-Score: -1.0 (-) X-Spam-Report: --- Textanalyse SpamAssassin 3.3.1 (-1.0 Punkte) Fragen an/questions to: Postmaster TU Chemnitz * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP --- Ende Textanalyse X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00327.txt.bz2 On Tue, Nov 12, 2013 at 03:25:04PM +0400, Joel Brobecker wrote: > [sorry for the duplicate, Tom, mishandling of the --to= send-email option] > > Hi Tom, > > > We could add a way to check for specific commands. Then new commands > > would never need to be added to the feature list. > > What do you think of the following? > > 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) I am not sure I agree with the judgement of benefits here. The basic yes/no information is already there: (gdb) -unsupported-command ^error,msg="Undefined MI command: unsupported-command" (gdb) -symbol-list-lines ^error,msg="-symbol-list-lines: Usage: SOURCE_FILENAME" It's not nice, but "works". In addition, a yes-or-no is not even what might be needed. Look e.g. at the "python" advertisement in -list-features output ^done,features=["frozen-varobjs","pending-breakpoints","thread-info", "data-read-memory-bytes","breakpoint-notifications","ada-task-info","python"] It does not indicate whether it is properly installed (datadir...) nor whether the version of Python is compatible with the script I want to execute. So in practice, checking -list-features is just extra effort giving only a subset of the information I would need for an "ok to use" decision, and it's quicker and more reliable to just execute the command and handle errors. It's hard to imagine that this will ever cover enough of GDB features and questions a frontend needs to have answered. Andre'