1130803Smarcel/* MI Command Set for GDB, the GNU debugger.
2130803Smarcel
3130803Smarcel   Copyright 2000, 2003, 2004 Free Software Foundation, Inc.
4130803Smarcel
598944Sobrien   Contributed by Cygnus Solutions (a Red Hat company).
698944Sobrien
798944Sobrien   This file is part of GDB.
898944Sobrien
998944Sobrien   This program is free software; you can redistribute it and/or modify
1098944Sobrien   it under the terms of the GNU General Public License as published by
1198944Sobrien   the Free Software Foundation; either version 2 of the License, or
1298944Sobrien   (at your option) any later version.
1398944Sobrien
1498944Sobrien   This program is distributed in the hope that it will be useful,
1598944Sobrien   but WITHOUT ANY WARRANTY; without even the implied warranty of
1698944Sobrien   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1798944Sobrien   GNU General Public License for more details.
1898944Sobrien
1998944Sobrien   You should have received a copy of the GNU General Public License
2098944Sobrien   along with this program; if not, write to the Free Software
2198944Sobrien   Foundation, Inc., 59 Temple Place - Suite 330,
2298944Sobrien   Boston, MA 02111-1307, USA.  */
2398944Sobrien
2498944Sobrien#ifndef MI_CMDS_H
2598944Sobrien#define MI_CMDS_H
2698944Sobrien
2798944Sobrien/* An MI command can return any of the following. */
2898944Sobrien
2998944Sobrienenum mi_cmd_result
3098944Sobrien  {
3198944Sobrien    /* Report the command as ``done''.  Display both the ``NNN^done''
3298944Sobrien       message and the completion prompt.  */
3398944Sobrien    MI_CMD_DONE = 0,
3498944Sobrien    /* The command is still running in the forground.  Main loop should
3598944Sobrien       display the completion prompt. */
3698944Sobrien    MI_CMD_FORGROUND,
3798944Sobrien    /* An error condition was detected and an error message was
3898944Sobrien       asprintf'd into the mi_error_message buffer.  The main loop will
3998944Sobrien       display the error message and the completion prompt. */
4098944Sobrien    MI_CMD_ERROR,
4198944Sobrien    /* An error condition was detected and caught.  The error message is
4298944Sobrien       in the global error message buffer. The main loop will display
4398944Sobrien       the error message and the completion prompt. */
4498944Sobrien    MI_CMD_CAUGHT_ERROR,
4598944Sobrien    /* The MI command has already displayed its completion message.
4698944Sobrien       Main loop will not display a completion message but will display
4798944Sobrien       the completion prompt. */
4898944Sobrien    MI_CMD_QUIET
4998944Sobrien  };
5098944Sobrien
51130803Smarcelenum print_values {
52130803Smarcel   PRINT_NO_VALUES,
53130803Smarcel   PRINT_ALL_VALUES,
54130803Smarcel   PRINT_SIMPLE_VALUES
55130803Smarcel};
56130803Smarcel
5798944Sobrientypedef enum mi_cmd_result (mi_cmd_argv_ftype) (char *command, char **argv, int argc);
5898944Sobrien
5998944Sobrien/* Older MI commands have this interface. Retained until all old
6098944Sobrien   commands are flushed. */
6198944Sobrien
6298944Sobrientypedef enum mi_cmd_result (mi_cmd_args_ftype) ( /*ui */ char *args, int from_tty);
6398944Sobrien
6498944Sobrien/* Function implementing each command */
6598944Sobrienextern mi_cmd_argv_ftype mi_cmd_break_insert;
6698944Sobrienextern mi_cmd_argv_ftype mi_cmd_break_watch;
6798944Sobrienextern mi_cmd_argv_ftype mi_cmd_disassemble;
6898944Sobrienextern mi_cmd_argv_ftype mi_cmd_data_evaluate_expression;
6998944Sobrienextern mi_cmd_argv_ftype mi_cmd_data_list_register_names;
7098944Sobrienextern mi_cmd_argv_ftype mi_cmd_data_list_register_values;
7198944Sobrienextern mi_cmd_argv_ftype mi_cmd_data_list_changed_registers;
7298944Sobrienextern mi_cmd_argv_ftype mi_cmd_data_read_memory;
7398944Sobrienextern mi_cmd_argv_ftype mi_cmd_data_write_memory;
7498944Sobrienextern mi_cmd_argv_ftype mi_cmd_data_write_register_values;
75130803Smarcelextern mi_cmd_argv_ftype mi_cmd_env_cd;
76130803Smarcelextern mi_cmd_argv_ftype mi_cmd_env_dir;
77130803Smarcelextern mi_cmd_argv_ftype mi_cmd_env_path;
78130803Smarcelextern mi_cmd_argv_ftype mi_cmd_env_pwd;
7998944Sobrienextern mi_cmd_args_ftype mi_cmd_exec_continue;
8098944Sobrienextern mi_cmd_args_ftype mi_cmd_exec_finish;
8198944Sobrienextern mi_cmd_args_ftype mi_cmd_exec_next;
8298944Sobrienextern mi_cmd_args_ftype mi_cmd_exec_next_instruction;
8398944Sobrienextern mi_cmd_args_ftype mi_cmd_exec_return;
8498944Sobrienextern mi_cmd_args_ftype mi_cmd_exec_run;
8598944Sobrienextern mi_cmd_args_ftype mi_cmd_exec_step;
8698944Sobrienextern mi_cmd_args_ftype mi_cmd_exec_step_instruction;
8798944Sobrienextern mi_cmd_args_ftype mi_cmd_exec_until;
8898944Sobrienextern mi_cmd_args_ftype mi_cmd_exec_interrupt;
89130803Smarcelextern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_file;
9098944Sobrienextern mi_cmd_argv_ftype mi_cmd_gdb_exit;
91130803Smarcelextern mi_cmd_argv_ftype mi_cmd_interpreter_exec;
9298944Sobrienextern mi_cmd_argv_ftype mi_cmd_stack_info_depth;
9398944Sobrienextern mi_cmd_argv_ftype mi_cmd_stack_list_args;
9498944Sobrienextern mi_cmd_argv_ftype mi_cmd_stack_list_frames;
9598944Sobrienextern mi_cmd_argv_ftype mi_cmd_stack_list_locals;
9698944Sobrienextern mi_cmd_argv_ftype mi_cmd_stack_select_frame;
97130803Smarcelextern mi_cmd_argv_ftype mi_cmd_symbol_list_lines;
9898944Sobrienextern mi_cmd_args_ftype mi_cmd_target_download;
9998944Sobrienextern mi_cmd_args_ftype mi_cmd_target_select;
10098944Sobrienextern mi_cmd_argv_ftype mi_cmd_thread_list_ids;
10198944Sobrienextern mi_cmd_argv_ftype mi_cmd_thread_select;
10298944Sobrienextern mi_cmd_argv_ftype mi_cmd_var_assign;
10398944Sobrienextern mi_cmd_argv_ftype mi_cmd_var_create;
10498944Sobrienextern mi_cmd_argv_ftype mi_cmd_var_delete;
10598944Sobrienextern mi_cmd_argv_ftype mi_cmd_var_evaluate_expression;
10698944Sobrienextern mi_cmd_argv_ftype mi_cmd_var_info_expression;
10798944Sobrienextern mi_cmd_argv_ftype mi_cmd_var_info_num_children;
10898944Sobrienextern mi_cmd_argv_ftype mi_cmd_var_info_type;
10998944Sobrienextern mi_cmd_argv_ftype mi_cmd_var_list_children;
11098944Sobrienextern mi_cmd_argv_ftype mi_cmd_var_set_format;
11198944Sobrienextern mi_cmd_argv_ftype mi_cmd_var_show_attributes;
11298944Sobrienextern mi_cmd_argv_ftype mi_cmd_var_show_format;
11398944Sobrienextern mi_cmd_argv_ftype mi_cmd_var_update;
11498944Sobrien
11598944Sobrien/* Description of a single command. */
11698944Sobrien
117130803Smarcelstruct mi_cli
118130803Smarcel{
119130803Smarcel  /* Corresponding CLI command.  If ARGS_P is non-zero, the MI
120130803Smarcel     command's argument list is appended to the CLI command.  */
121130803Smarcel  const char *cmd;
122130803Smarcel  int args_p;
123130803Smarcel};
124130803Smarcel
12598944Sobrienstruct mi_cmd
126130803Smarcel{
127130803Smarcel  /* official name of the command.  */
128130803Smarcel  const char *name;
129130803Smarcel  /* The corresponding CLI command that can be used to implement this
130130803Smarcel     MI command (if cli.lhs is non NULL).  */
131130803Smarcel  struct mi_cli cli;
132130803Smarcel  /* If non-null, the function implementing the MI command.  */
133130803Smarcel  mi_cmd_args_ftype *args_func;
134130803Smarcel  /* If non-null, the function implementing the MI command.  */
135130803Smarcel  mi_cmd_argv_ftype *argv_func;
136130803Smarcel};
13798944Sobrien
13898944Sobrien/* Lookup a command in the mi comand table */
13998944Sobrien
14098944Sobrienextern struct mi_cmd *mi_lookup (const char *command);
14198944Sobrien
14298944Sobrien/* Debug flag */
14398944Sobrienextern int mi_debug_p;
14498944Sobrien
14598944Sobrien/* Raw console output - FIXME: should this be a parameter? */
14698944Sobrienextern struct ui_file *raw_stdout;
14798944Sobrien
148130803Smarcelextern char *mi_error_message;
149130803Smarcelextern void mi_error_last_message (void);
150130803Smarcelextern void mi_execute_command (char *cmd, int from_tty);
151130803Smarcel
15298944Sobrien#endif
153