From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27922 invoked by alias); 14 Nov 2013 18:44: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 27892 invoked by uid 89); 14 Nov 2013 18:44:35 -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_05,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; Thu, 14 Nov 2013 18:44:33 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAEIiMJJ024551 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 14 Nov 2013 13:44:22 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rAEIiKdl012706; Thu, 14 Nov 2013 13:44:21 -0500 Message-ID: <52851A04.6040004@redhat.com> Date: Thu, 14 Nov 2013 19:03: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: =?ISO-8859-1?Q?Andr=E9_P=F6nitz?= , Tom Tromey , 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> In-Reply-To: <20131113021514.GG3481@adacore.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-11/txt/msg00383.txt.bz2 On 11/13/2013 02:15 AM, Joel Brobecker wrote: >> 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". > I disagree with your assessment of "works". I can think of a number > of scenarios where this would be problematic: > > The first and most obvious to me is the case where the debugger is > run with a non-English LANG. If you base your detection on parsing > the error msg, then i18n ruins your plan. And if you base your detection > on the presence of the error alone, then commands that take no argument > may return an error, which by no means indicates that the command does not > exist. Yeah. I think that points out that errors like "Undefined MI command:" and "Usage:" errors are in a different class of errors from errors caused by user input though. The former should never ever be seen by the user. They're "internal" gdb<->frontend errors. We could/should tag these differently somehow, so that the frontend doesn't have to parse a free form string. Like: "^error,msg="..." "^error,msg="...",code="unknown-command" "^error,msg="...",code="usage" or some such. This does not invalidate listing features in -list-features, as it's often useful to know upfront whether some feature is supported, so the frontend can disable parts of the GUI that won't make sense for the current target/session. -- Pedro Alves