From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3876 invoked by alias); 18 Nov 2013 17:29:31 -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 3866 invoked by uid 89); 18 Nov 2013 17:29:30 -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_50,RDNS_NONE,SPF_SOFTFAIL,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mtaout23.012.net.il Received: from Unknown (HELO mtaout23.012.net.il) (80.179.55.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Nov 2013 17:29:29 +0000 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MWG00D00Z2G8Y00@a-mtaout23.012.net.il> for gdb-patches@sourceware.org; Mon, 18 Nov 2013 19:29:21 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MWG00DG3Z8W5H80@a-mtaout23.012.net.il>; Mon, 18 Nov 2013 19:29:21 +0200 (IST) Date: Mon, 18 Nov 2013 17:29:00 -0000 From: Eli Zaretskii Subject: Re: [RFA 2/2] Add "undefined-command" error code at end of ^error result... In-reply-to: <1384794719-20594-3-git-send-email-brobecker@adacore.com> To: Joel Brobecker Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83wqk5fwk4.fsf@gnu.org> References: <528631F2.40408@redhat.com> <1384794719-20594-1-git-send-email-brobecker@adacore.com> <1384794719-20594-3-git-send-email-brobecker@adacore.com> X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00482.txt.bz2 > From: Joel Brobecker > Date: Mon, 18 Nov 2013 21:11:59 +0400 > > This patch improves the situation by adding concept of error > code, starting with one well-defined error code ("undefined-command") > identifying errors due to a non-existant command. Here is the new > output: > > -unsupported > ^error,msg="Undefined MI command: unsupported",code="undefined-command" > > This error code is only displayed when the corresponding error > condition is met. Otherwise, the error record remains unchanged. > For instance: > > -symbol-list-lines foo.adb > ^error,msg="-symbol-list-lines: Unknown source file name." Doesn't this constitute a reason for bumping the MI revision? > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -156,6 +156,10 @@ show startup-with-shell > ** The new command -info-gdb-mi-command allows the user to determine > whether a GDB/MI command is supported or not. > > + ** The "^error" result record returned when trying to execute an undefined > + GDB/MI command now provides a variable named "code" whose content is the > + "undefined-command" error code. OK, but I would mention the fact that this can be inquired about, as you described in your message. > +@item "^error" "," "msg=" @var{c-string} [ "," "code=" @var{c-string} ] > @findex ^error > -The operation failed. The @code{@var{c-string}} contains the corresponding > +The operation failed. The @var{msg} variable contains the corresponding > error message. > > +If present, the @var{code} variable provides an error code on which The markup is wrong here: "code" is not a variable, it is a literal symbol. You probably meant "c-string" instead. Otherwise, the documentation parts are OK.