From a7e332c24b77168bc61d4ee776bf29c831fbbc88 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Thu, 7 Nov 2013 17:15:46 +0400 Subject: 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/testsuite/gdb.ada/mi_exc_info/const.ads | 18 ++++++++++++++++++ gdb/testsuite/gdb.ada/mi_exc_info/foo.adb | 20 ++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 gdb/testsuite/gdb.ada/mi_exc_info/const.ads create mode 100644 gdb/testsuite/gdb.ada/mi_exc_info/foo.adb (limited to 'gdb/testsuite/gdb.ada/mi_exc_info') diff --git a/gdb/testsuite/gdb.ada/mi_exc_info/const.ads b/gdb/testsuite/gdb.ada/mi_exc_info/const.ads new file mode 100644 index 0000000..753241e --- /dev/null +++ b/gdb/testsuite/gdb.ada/mi_exc_info/const.ads @@ -0,0 +1,18 @@ +-- Copyright 2013 Free Software Foundation, Inc. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +package Const is + Aint_Global_E : exception; +end Const; diff --git a/gdb/testsuite/gdb.ada/mi_exc_info/foo.adb b/gdb/testsuite/gdb.ada/mi_exc_info/foo.adb new file mode 100644 index 0000000..e047db2 --- /dev/null +++ b/gdb/testsuite/gdb.ada/mi_exc_info/foo.adb @@ -0,0 +1,20 @@ +-- Copyright 2013 Free Software Foundation, Inc. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +with Const; use Const; +procedure Foo is +begin + raise Aint_Global_E; +end Foo; -- cgit v1.1