1 /* MI Command Set - information commands.
2 Copyright (C) 2011-2013 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 #include "arch-utils.h"
25 /* Implement the "-info-ada-exceptions" GDB/MI command. */
28 mi_cmd_info_ada_exceptions (char *command, char **argv, int argc)
30 struct ui_out *uiout = current_uiout;
31 struct gdbarch *gdbarch = get_current_arch ();
33 struct cleanup *old_chain;
34 VEC(ada_exc_info) *exceptions;
36 struct ada_exc_info *info;
47 error (_("Usage: -info-ada-exceptions [REGEXP]"));
51 exceptions = ada_exceptions_list (regexp);
52 old_chain = make_cleanup (VEC_cleanup (ada_exc_info), &exceptions);
54 make_cleanup_ui_out_table_begin_end
55 (uiout, 2, VEC_length (ada_exc_info, exceptions), "ada-exceptions");
56 ui_out_table_header (uiout, 1, ui_left, "name", "Name");
57 ui_out_table_header (uiout, 1, ui_left, "address", "Address");
58 ui_out_table_body (uiout);
60 for (ix = 0; VEC_iterate(ada_exc_info, exceptions, ix, info); ix++)
62 struct cleanup *sub_chain;
64 sub_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
65 ui_out_field_string (uiout, "name", info->name);
66 ui_out_field_core_addr (uiout, "address", gdbarch, info->addr);
68 do_cleanups (sub_chain);
71 do_cleanups (old_chain);
75 mi_cmd_info_os (char *command, char **argv, int argc)
80 info_osdata_command ("", 0);
83 info_osdata_command (argv[0], 0);
86 error (_("Usage: -info-os [INFOTYPE]"));