Implement GDB/MI equivalent of "info exceptions" CLI command.
authorJoel Brobecker <brobecker@adacore.com>
Thu, 7 Nov 2013 13:15:46 +0000 (17:15 +0400)
committerJoel Brobecker <brobecker@adacore.com>
Tue, 12 Nov 2013 02:47:16 +0000 (06:47 +0400)
commita7e332c24b77168bc61d4ee776bf29c831fbbc88
tree180fde49796f2937620185c5e0ae2b82ecc02477
parent778865d3e288f4fcf3b293e78d52cd5dacb4b999
Implement GDB/MI equivalent of "info exceptions" CLI command.

This patch implements a new GDB/MI command implementing the equivalent
of the "info exceptions" CLI command.  The command syntax is:

    -info-ada-exceptions [REGEXP]

Here is an example of usage (slightly formatted by hand to make it
easier to read):

    -info-ada-exceptions ions\.a_
    ^done,ada-exceptions=
      {nr_rows="2",nr_cols="2",
       hdr=[{width="1",alignment="-1",col_name="name",colhdr="Name"},
            {width="1",alignment="-1",col_name="address",colhdr="Address"}],
       body=[{name="global_exceptions.a_global_exception",
              address="0x0000000000613a80"},
             {name="global_exceptions.a_private_exception",
              address="0x0000000000613ac0"}]}

Also, in order to allow graphical frontends to easily determine
whether this command is available or not, the output of the
"-list-features" command has been augmented to contain
"info-ada-exceptions".

gdb/Changelog:

        * mi/mi-cmds.h (mi_cmd_info_ada_exceptions): Add declaration.
        * mi/mi-cmds.c (mi_cmds): Add entry for -info-ada-exceptions
        command.
        * mi/mi-cmd-info.c: #include "ada-lang.c" and "arch-utils.c".
        (mi_cmd_info_ada_exceptions): New function.
        * mi/mi-main.c (mi_cmd_list_features): Add "info-ada-exceptions".

gdb/testsuite/ChangeLog:

        * gdb.ada/mi_exc_info: New testcase.
gdb/mi/mi-cmd-info.c
gdb/mi/mi-cmds.c
gdb/mi/mi-cmds.h
gdb/mi/mi-main.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/mi_exc_info.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/mi_exc_info/const.ads [new file with mode: 0644]
gdb/testsuite/gdb.ada/mi_exc_info/foo.adb [new file with mode: 0644]