This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA 2/2] Add "undefined-command" error code at end of ^error result...


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]