This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 2/2] Add "undefined-command" error code at end of ^error result...
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 18 Nov 2013 19:29:15 +0200
- Subject: Re: [RFA 2/2] Add "undefined-command" error code at end of ^error result...
- Authentication-results: sourceware.org; auth=none
- References: <528631F2 dot 40408 at redhat dot com> <1384794719-20594-1-git-send-email-brobecker at adacore dot com> <1384794719-20594-3-git-send-email-brobecker at adacore dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Joel Brobecker <brobecker@adacore.com>
> 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.