gdb/mi: rename mi_lookup to mi_cmd_lookup
[binutils-gdb.git] / gdb / mi / mi-cmds.h
index 7b3eb0e3bae54a8bdd91ae4d98e7a1b108b4b7f4..e92737be8c840261bfa004576b02773d16bbb491 100644 (file)
@@ -1,6 +1,6 @@
 /* MI Command Set for GDB, the GNU debugger.
 
-   Copyright (C) 2000, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions (a Red Hat company).
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef MI_CMDS_H
-#define MI_CMDS_H
-
-/* An MI command can return any of the following. */
-
-enum mi_cmd_result
-  {
-    /* Report the command as ``done''.  Display both the ``NNN^done''
-       message and the completion prompt.  */
-    MI_CMD_DONE = 0,
-    /* The command is still running in the forground.  Main loop should
-       display the completion prompt. */
-    MI_CMD_FORGROUND,
-    /* An error condition was detected and an error message was
-       asprintf'd into the mi_error_message buffer.  The main loop will
-       display the error message and the completion prompt. */
-    MI_CMD_ERROR,
-    /* The MI command has already displayed its completion message.
-       Main loop will not display a completion message but will display
-       the completion prompt. */
-    MI_CMD_QUIET
-  };
+#ifndef MI_MI_CMDS_H
+#define MI_MI_CMDS_H
 
 enum print_values {
    PRINT_NO_VALUES,
@@ -48,60 +28,95 @@ enum print_values {
    PRINT_SIMPLE_VALUES
 };
 
-extern const char mi_no_values[];
-extern const char mi_simple_values[];
-extern const char mi_all_values[];
+typedef void (mi_cmd_argv_ftype) (const char *command, char **argv, int argc);
 
-typedef enum mi_cmd_result (mi_cmd_argv_ftype) (char *command, char **argv, int argc);
+/* Declarations of the functions implementing each command.  */
 
-/* Older MI commands have this interface. Retained until all old
-   commands are flushed. */
-
-typedef enum mi_cmd_result (mi_cmd_args_ftype) ( /*ui */ char *args, int from_tty);
-
-/* Function implementing each command */
+extern mi_cmd_argv_ftype mi_cmd_ada_task_info;
+extern mi_cmd_argv_ftype mi_cmd_add_inferior;
 extern mi_cmd_argv_ftype mi_cmd_break_insert;
+extern mi_cmd_argv_ftype mi_cmd_dprintf_insert;
+extern mi_cmd_argv_ftype mi_cmd_break_condition;
+extern mi_cmd_argv_ftype mi_cmd_break_commands;
+extern mi_cmd_argv_ftype mi_cmd_break_passcount;
 extern mi_cmd_argv_ftype mi_cmd_break_watch;
+extern mi_cmd_argv_ftype mi_cmd_catch_assert;
+extern mi_cmd_argv_ftype mi_cmd_catch_exception;
+extern mi_cmd_argv_ftype mi_cmd_catch_handlers;
+extern mi_cmd_argv_ftype mi_cmd_catch_load;
+extern mi_cmd_argv_ftype mi_cmd_catch_unload;
+extern mi_cmd_argv_ftype mi_cmd_catch_throw;
+extern mi_cmd_argv_ftype mi_cmd_catch_rethrow;
+extern mi_cmd_argv_ftype mi_cmd_catch_catch;
 extern mi_cmd_argv_ftype mi_cmd_disassemble;
 extern mi_cmd_argv_ftype mi_cmd_data_evaluate_expression;
 extern mi_cmd_argv_ftype mi_cmd_data_list_register_names;
 extern mi_cmd_argv_ftype mi_cmd_data_list_register_values;
 extern mi_cmd_argv_ftype mi_cmd_data_list_changed_registers;
 extern mi_cmd_argv_ftype mi_cmd_data_read_memory;
+extern mi_cmd_argv_ftype mi_cmd_data_read_memory_bytes;
 extern mi_cmd_argv_ftype mi_cmd_data_write_memory;
+extern mi_cmd_argv_ftype mi_cmd_data_write_memory_bytes;
 extern mi_cmd_argv_ftype mi_cmd_data_write_register_values;
 extern mi_cmd_argv_ftype mi_cmd_enable_timings;
 extern mi_cmd_argv_ftype mi_cmd_env_cd;
 extern mi_cmd_argv_ftype mi_cmd_env_dir;
 extern mi_cmd_argv_ftype mi_cmd_env_path;
 extern mi_cmd_argv_ftype mi_cmd_env_pwd;
-extern mi_cmd_args_ftype mi_cmd_exec_continue;
-extern mi_cmd_args_ftype mi_cmd_exec_finish;
-extern mi_cmd_args_ftype mi_cmd_exec_next;
-extern mi_cmd_args_ftype mi_cmd_exec_next_instruction;
-extern mi_cmd_args_ftype mi_cmd_exec_return;
-extern mi_cmd_args_ftype mi_cmd_exec_run;
-extern mi_cmd_args_ftype mi_cmd_exec_step;
-extern mi_cmd_args_ftype mi_cmd_exec_step_instruction;
-extern mi_cmd_args_ftype mi_cmd_exec_until;
-extern mi_cmd_args_ftype mi_cmd_exec_interrupt;
+extern mi_cmd_argv_ftype mi_cmd_exec_continue;
+extern mi_cmd_argv_ftype mi_cmd_exec_finish;
+extern mi_cmd_argv_ftype mi_cmd_exec_interrupt;
+extern mi_cmd_argv_ftype mi_cmd_exec_jump;
+extern mi_cmd_argv_ftype mi_cmd_exec_next;
+extern mi_cmd_argv_ftype mi_cmd_exec_next_instruction;
+extern mi_cmd_argv_ftype mi_cmd_exec_return;
+extern mi_cmd_argv_ftype mi_cmd_exec_run;
+extern mi_cmd_argv_ftype mi_cmd_exec_step;
+extern mi_cmd_argv_ftype mi_cmd_exec_step_instruction;
 extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_file;
 extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_files;
+extern mi_cmd_argv_ftype mi_cmd_file_list_shared_libraries;
 extern mi_cmd_argv_ftype mi_cmd_gdb_exit;
 extern mi_cmd_argv_ftype mi_cmd_inferior_tty_set;
 extern mi_cmd_argv_ftype mi_cmd_inferior_tty_show;
+extern mi_cmd_argv_ftype mi_cmd_info_ada_exceptions;
+extern mi_cmd_argv_ftype mi_cmd_info_gdb_mi_command;
+extern mi_cmd_argv_ftype mi_cmd_info_os;
 extern mi_cmd_argv_ftype mi_cmd_interpreter_exec;
+extern mi_cmd_argv_ftype mi_cmd_list_features;
+extern mi_cmd_argv_ftype mi_cmd_list_target_features;
+extern mi_cmd_argv_ftype mi_cmd_list_thread_groups;
+extern mi_cmd_argv_ftype mi_cmd_remove_inferior;
 extern mi_cmd_argv_ftype mi_cmd_stack_info_depth;
 extern mi_cmd_argv_ftype mi_cmd_stack_info_frame;
 extern mi_cmd_argv_ftype mi_cmd_stack_list_args;
 extern mi_cmd_argv_ftype mi_cmd_stack_list_frames;
 extern mi_cmd_argv_ftype mi_cmd_stack_list_locals;
+extern mi_cmd_argv_ftype mi_cmd_stack_list_variables;
 extern mi_cmd_argv_ftype mi_cmd_stack_select_frame;
 extern mi_cmd_argv_ftype mi_cmd_symbol_list_lines;
-extern mi_cmd_args_ftype mi_cmd_target_download;
-extern mi_cmd_args_ftype mi_cmd_target_select;
+extern mi_cmd_argv_ftype mi_cmd_symbol_info_functions;
+extern mi_cmd_argv_ftype mi_cmd_symbol_info_module_functions;
+extern mi_cmd_argv_ftype mi_cmd_symbol_info_module_variables;
+extern mi_cmd_argv_ftype mi_cmd_symbol_info_modules;
+extern mi_cmd_argv_ftype mi_cmd_symbol_info_types;
+extern mi_cmd_argv_ftype mi_cmd_symbol_info_variables;
+extern mi_cmd_argv_ftype mi_cmd_target_detach;
+extern mi_cmd_argv_ftype mi_cmd_target_file_get;
+extern mi_cmd_argv_ftype mi_cmd_target_file_put;
+extern mi_cmd_argv_ftype mi_cmd_target_file_delete;
+extern mi_cmd_argv_ftype mi_cmd_target_flash_erase;
+extern mi_cmd_argv_ftype mi_cmd_thread_info;
 extern mi_cmd_argv_ftype mi_cmd_thread_list_ids;
 extern mi_cmd_argv_ftype mi_cmd_thread_select;
+extern mi_cmd_argv_ftype mi_cmd_trace_define_variable;
+extern mi_cmd_argv_ftype mi_cmd_trace_find;
+extern mi_cmd_argv_ftype mi_cmd_trace_frame_collected;
+extern mi_cmd_argv_ftype mi_cmd_trace_list_variables;
+extern mi_cmd_argv_ftype mi_cmd_trace_save;
+extern mi_cmd_argv_ftype mi_cmd_trace_start;
+extern mi_cmd_argv_ftype mi_cmd_trace_status;
+extern mi_cmd_argv_ftype mi_cmd_trace_stop;
 extern mi_cmd_argv_ftype mi_cmd_var_assign;
 extern mi_cmd_argv_ftype mi_cmd_var_create;
 extern mi_cmd_argv_ftype mi_cmd_var_delete;
@@ -113,11 +128,16 @@ extern mi_cmd_argv_ftype mi_cmd_var_info_type;
 extern mi_cmd_argv_ftype mi_cmd_var_list_children;
 extern mi_cmd_argv_ftype mi_cmd_var_set_format;
 extern mi_cmd_argv_ftype mi_cmd_var_set_frozen;
+extern mi_cmd_argv_ftype mi_cmd_var_set_visualizer;
 extern mi_cmd_argv_ftype mi_cmd_var_show_attributes;
 extern mi_cmd_argv_ftype mi_cmd_var_show_format;
 extern mi_cmd_argv_ftype mi_cmd_var_update;
+extern mi_cmd_argv_ftype mi_cmd_enable_pretty_printing;
+extern mi_cmd_argv_ftype mi_cmd_enable_frame_filters;
+extern mi_cmd_argv_ftype mi_cmd_var_set_update_range;
+extern mi_cmd_argv_ftype mi_cmd_complete;
 
-/* Description of a single command. */
+/* Description of a single command.  */
 
 struct mi_cli
 {
@@ -129,28 +149,29 @@ struct mi_cli
 
 struct mi_cmd
 {
-  /* official name of the command.  */
+  /* Official name of the command.  */
   const char *name;
   /* The corresponding CLI command that can be used to implement this
      MI command (if cli.lhs is non NULL).  */
   struct mi_cli cli;
   /* If non-null, the function implementing the MI command.  */
-  mi_cmd_args_ftype *args_func;
-  /* If non-null, the function implementing the MI command.  */
   mi_cmd_argv_ftype *argv_func;
+  /* If non-null, the pointer to a field in
+     'struct mi_suppress_notification', which will be set to true by MI
+     command processor (mi-main.c:mi_cmd_execute) when this command is
+     being executed.  It will be set back to false when command has been
+     executed.  */
+  int *suppress_notification;
 };
 
-/* Lookup a command in the mi comand table */
+/* Lookup a command in the MI command table, returns nullptr if COMMAND is
+   not found.  */
 
-extern struct mi_cmd *mi_lookup (const char *command);
+extern struct mi_cmd *mi_cmd_lookup (const char *command);
 
 /* Debug flag */
 extern int mi_debug_p;
 
-/* Raw console output - FIXME: should this be a parameter? */
-extern struct ui_file *raw_stdout;
-
-extern char *mi_error_message;
-extern void mi_execute_command (char *cmd, int from_tty);
+extern void mi_execute_command (const char *cmd, int from_tty);
 
-#endif
+#endif /* MI_MI_CMDS_H */