This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
gdb and binutils branch master updated. 2ea126fa785cf0d2b26cdba5c6ad8b8548b7ef15
- From: brobecke at sourceware dot org
- To: gdb-cvs at sourceware dot org
- Date: 3 Dec 2013 04:04:29 -0000
- Subject: gdb and binutils branch master updated. 2ea126fa785cf0d2b26cdba5c6ad8b8548b7ef15
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".
The branch, master has been updated
via 2ea126fa785cf0d2b26cdba5c6ad8b8548b7ef15 (commit)
via 6b7cbff192a5335b96fdcf887b32fc6e0100b6ef (commit)
from 310bf259c3524c29542f01514bae4be2f21d903e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2ea126fa785cf0d2b26cdba5c6ad8b8548b7ef15
commit 2ea126fa785cf0d2b26cdba5c6ad8b8548b7ef15
Author: Joel Brobecker <brobecker@adacore.com>
Date: Mon Nov 18 16:55:16 2013 +0400
Add "undefined-command" error code at end of ^error result...
... when trying to execute an undefined GDB/MI command. When trying
to execute a GDB/MI command which does not exist, the current error
result record looks like this:
-unsupported
^error,msg="Undefined MI command: unsupported"
The only indication that the command does not exist is the error
message. It would be a little fragile for a consumer to rely solely
on the contents of the error message in order to determine whether
a command exists or not.
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."
For frontends to be able to know whether they can rely on this
variable, a new entry "undefined-command-error-code" has been
added to the "-list-features" command. Another option would be
to always generate an error="..." variable (for the default case,
we could decide for instance that the error code is the empty string).
But it seems more efficient to provide that info in "-list-features"
and then only add the error code when meaningful.
gdb/ChangeLog:
(from Pedro Alves <palves@redhat.com>)
(from Joel Brobecker <brobecker@adacore.com>)
* exceptions.h (enum_errors) <UNDEFINED_COMMAND_ERROR>: New enum.
* mi/mi-parse.c (mi_parse): Throw UNDEFINED_COMMAND_ERROR instead
of a regular error when the GDB/MI command does not exist.
* mi/mi-main.c (mi_cmd_list_features): Add
"undefined-command-error-code".
(mi_print_exception): Print an "undefined-command"
error code if EXCEPTION.ERROR is UNDEFINED_COMMAND_ERROR.
* NEWS: Add entry documenting the new "code" variable in
"^error" result records.
gdb/doc/ChangeLog:
* gdb.texinfo (GDB/MI Result Records): Fix the syntax of the
"^error" result record concerning the error message. Document
the error code that may also be part of that result record.
(GDB/MI Miscellaneous Commands): Document the
"undefined-command-error-code" element in the output of
the "-list-features" GDB/MI command.
gdb/testsuite/ChangeLog:
* gdb.mi/mi-undefined-cmd.exp: New testcase.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6b7cbff192a5335b96fdcf887b32fc6e0100b6ef
commit 6b7cbff192a5335b96fdcf887b32fc6e0100b6ef
Author: Joel Brobecker <brobecker@adacore.com>
Date: Tue Nov 12 14:51:30 2013 +0400
New GDB/MI command "-info-gdb-mi-command"
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)
At the moment, this is the only piece of information that this
command returns.
Eventually, and if needed, we can extend it to provide
command-specific pieces of information, such as updates to
the command's syntax since inception. This could become,
for instance:
-info-gdb-mi-command symbol-list-lines
^done,command={exists="true",features=[]}
(gdb)
-info-gdb-mi-command catch-assert
^done,command={exists="true",features=["conditions"]}
In the first case, it would mean that no extra features,
while in the second, it announces that the -catch-assert
command in this version of the debugger supports a feature
called "condition" - exact semantics to be documented with
combined with the rest of the queried command's documentation.
But for now, we start small, and only worry about existance.
And to bootstrap the process, I have added an entry in the
output of the -list-features command as well ("info-gdb-mi-command"),
allowing the graphical frontends to go through the following process:
1. Send -list-features, collect info from there as before;
2. Check if the output contains "info-gdb-mi-command".
If it does, then support for various commands can be
queried though -info-gdb-mi-command. Newer commands
will be expected to always be checked via this new
-info-gdb-mi-command.
gdb/ChangeLog:
* mi/mi-cmds.h (mi_cmd_info_gdb_mi_command): Declare.
* mi/mi-cmd-info.c (mi_cmd_info_gdb_mi_command): New function.
* mi/mi-cmds.c (mi_cmds): Add -info-gdb-mi-command command.
* mi/mi-main.c (mi_cmd_list_features): Add "info-gdb-mi-command"
field to output of "-list-features".
* NEWS: Add entry for new -info-gdb-mi-command.
gdb/doc/ChangeLog:
* gdb.texinfo (GDB/MI Miscellaneous Commands): Document
the new -info-gdb-mi-command GDB/MI command. Document
the meaning of "-info-gdb-mi-command" in the output of
-list-features.
gdb/testsuite/ChangeLog:
* gdb.mi/mi-i-cmd.exp: New file.
-----------------------------------------------------------------------
Summary of changes:
gdb/ChangeLog | 23 +++++++++
gdb/NEWS | 9 ++++
gdb/doc/ChangeLog | 16 ++++++
gdb/doc/gdb.texinfo | 72 +++++++++++++++++++++++++++-
gdb/exceptions.h | 3 +
gdb/mi/mi-cmd-info.c | 29 ++++++++++++
gdb/mi/mi-cmds.c | 1 +
gdb/mi/mi-cmds.h | 1 +
gdb/mi/mi-main.c | 13 +++++-
gdb/mi/mi-parse.c | 3 +-
gdb/testsuite/ChangeLog | 8 +++
gdb/testsuite/gdb.mi/mi-i-cmd.exp | 46 ++++++++++++++++++
gdb/testsuite/gdb.mi/mi-undefined-cmd.exp | 33 +++++++++++++
13 files changed, 252 insertions(+), 5 deletions(-)
create mode 100644 gdb/testsuite/gdb.mi/mi-i-cmd.exp
create mode 100644 gdb/testsuite/gdb.mi/mi-undefined-cmd.exp
hooks/post-receive
--
gdb and binutils