1 /* MI Command Set - information commands.
2 Copyright (C) 2011-2024 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/>. */
22 #include "arch-utils.h"
24 /* Implement the "-info-ada-exceptions" GDB/MI command. */
27 mi_cmd_info_ada_exceptions (const char *command
, const char *const *argv
,
30 struct ui_out
*uiout
= current_uiout
;
31 struct gdbarch
*gdbarch
= get_current_arch ();
43 error (_("Usage: -info-ada-exceptions [REGEXP]"));
47 std::vector
<ada_exc_info
> exceptions
= ada_exceptions_list (regexp
);
49 ui_out_emit_table
table_emitter (uiout
, 2,
52 uiout
->table_header (1, ui_left
, "name", "Name");
53 uiout
->table_header (1, ui_left
, "address", "Address");
56 for (const ada_exc_info
&info
: exceptions
)
58 ui_out_emit_tuple
tuple_emitter (uiout
, NULL
);
59 uiout
->field_string ("name", info
.name
);
60 uiout
->field_core_addr ("address", gdbarch
, info
.addr
);
64 /* Implement the "-info-gdb-mi-command" GDB/MI command. */
67 mi_cmd_info_gdb_mi_command (const char *command
, const char *const *argv
,
72 struct ui_out
*uiout
= current_uiout
;
74 /* This command takes exactly one argument. */
76 error (_("Usage: -info-gdb-mi-command MI_COMMAND_NAME"));
79 /* Normally, the command name (aka the "operation" in the GDB/MI
80 grammar), does not include the leading '-' (dash). But for
81 the user's convenience, allow the user to specify the command
82 name to be with or without that leading dash. */
83 if (cmd_name
[0] == '-')
86 cmd
= mi_cmd_lookup (cmd_name
);
88 ui_out_emit_tuple
tuple_emitter (uiout
, "command");
89 uiout
->field_string ("exists", cmd
!= NULL
? "true" : "false");
93 mi_cmd_info_os (const char *command
, const char *const *argv
, int argc
)
101 info_osdata (argv
[0]);
104 error (_("Usage: -info-os [INFOTYPE]"));