gdb/
[deliverable/binutils-gdb.git] / gdb / mi / mi-cmds.c
index 49111464b5cc7c4418386f001637bc254085913f..79fbba14730192cb9944a90e02e6e5cee591943e 100644 (file)
@@ -1,7 +1,6 @@
 /* MI Command Set for GDB, the GNU debugger.
-
-   Copyright (C) 2000, 2001, 2003, 2007, 2008, 2009
-   Free Software Foundation, Inc.
+   Copyright (C) 2000-2001, 2003, 2007-2012 Free Software Foundation,
+   Inc.
 
    Contributed by Cygnus Solutions (a Red Hat company).
 
 #include "gdb_string.h"
 
 extern void _initialize_mi_cmds (void);
+
 struct mi_cmd;
 static struct mi_cmd **lookup_table (const char *command);
 static void build_table (struct mi_cmd *commands);
 
-
 struct mi_cmd mi_cmds[] =
 {
+  { "ada-task-info", { NULL, 0 }, mi_cmd_ada_task_info },
+  { "add-inferior", { NULL, 0 }, mi_cmd_add_inferior },
   { "break-after", { "ignore", 1 }, NULL },
   { "break-condition", { "cond", 1 }, NULL },
+  { "break-commands", { NULL, 0 }, mi_cmd_break_commands },
   { "break-delete", { "delete breakpoint", 1 }, NULL },
   { "break-disable", { "disable breakpoint", 1 }, NULL },
   { "break-enable", { "enable breakpoint", 1 }, NULL },
   { "break-info", { "info break", 1 }, NULL },
   { "break-insert", { NULL, 0 }, mi_cmd_break_insert},
   { "break-list", { "info break", }, NULL },
+  { "break-passcount", { NULL, 0 }, mi_cmd_break_passcount},
   { "break-watch", { NULL, 0 }, mi_cmd_break_watch},
   { "data-disassemble", { NULL, 0 }, mi_cmd_disassemble},
   { "data-evaluate-expression", { NULL, 0 }, mi_cmd_data_evaluate_expression},
-  { "data-list-changed-registers", { NULL, 0 }, mi_cmd_data_list_changed_registers},
+  { "data-list-changed-registers", { NULL, 0 },
+    mi_cmd_data_list_changed_registers},
   { "data-list-register-names", { NULL, 0 }, mi_cmd_data_list_register_names},
-  { "data-list-register-values", { NULL, 0 }, mi_cmd_data_list_register_values},
+  { "data-list-register-values", { NULL, 0 },
+    mi_cmd_data_list_register_values},
   { "data-read-memory", { NULL, 0 }, mi_cmd_data_read_memory},
+  { "data-read-memory-bytes", { NULL, 0 }, mi_cmd_data_read_memory_bytes},
   { "data-write-memory", { NULL, 0 }, mi_cmd_data_write_memory},
-  { "data-write-register-values", { NULL, 0 }, mi_cmd_data_write_register_values},
+  { "data-write-memory-bytes", {NULL, 0}, mi_cmd_data_write_memory_bytes},
+  { "data-write-register-values", { NULL, 0 },
+    mi_cmd_data_write_register_values},
   { "enable-timings", { NULL, 0 }, mi_cmd_enable_timings},
+  { "enable-pretty-printing", { NULL, 0 }, mi_cmd_enable_pretty_printing},
   { "environment-cd", { NULL, 0 }, mi_cmd_env_cd},
   { "environment-directory", { NULL, 0 }, mi_cmd_env_dir},
   { "environment-path", { NULL, 0 }, mi_cmd_env_path},
@@ -63,14 +72,16 @@ struct mi_cmd mi_cmds[] =
   { "exec-next", { NULL, 0 }, mi_cmd_exec_next},
   { "exec-next-instruction", { NULL, 0 }, mi_cmd_exec_next_instruction},
   { "exec-return", { NULL, 0 }, mi_cmd_exec_return},
-  { "exec-run", { "run", 1 }, NULL},
+  { "exec-run", { NULL, 0}, mi_cmd_exec_run},
   { "exec-step", { NULL, 0 }, mi_cmd_exec_step},
   { "exec-step-instruction", { NULL, 0 }, mi_cmd_exec_step_instruction},
   { "exec-until", { "until", 1 }, NULL},
   { "file-exec-and-symbols", { "file", 1 }, NULL },
   { "file-exec-file", { "exec-file", 1 }, NULL },
-  { "file-list-exec-source-file", { NULL, 0 }, mi_cmd_file_list_exec_source_file},
-  { "file-list-exec-source-files", { NULL, 0 }, mi_cmd_file_list_exec_source_files },
+  { "file-list-exec-source-file", { NULL, 0 },
+    mi_cmd_file_list_exec_source_file},
+  { "file-list-exec-source-files", { NULL, 0 },
+    mi_cmd_file_list_exec_source_files },
   { "file-symbol-file", { "symbol-file", 1 }, NULL },
   { "gdb-exit", { NULL, 0 }, mi_cmd_gdb_exit},
   { "gdb-set", { "set", 1 }, NULL },
@@ -78,15 +89,18 @@ struct mi_cmd mi_cmds[] =
   { "gdb-version", { "show version", 0 }, 0 },
   { "inferior-tty-set", { NULL, 0 }, mi_cmd_inferior_tty_set},
   { "inferior-tty-show", { NULL, 0 }, mi_cmd_inferior_tty_show},
+  { "info-os", { NULL, 0 }, mi_cmd_info_os},
   { "interpreter-exec", { NULL, 0 }, mi_cmd_interpreter_exec},
   { "list-features", { NULL, 0 }, mi_cmd_list_features},
   { "list-target-features", { NULL, 0 }, mi_cmd_list_target_features},
   { "list-thread-groups", { NULL, 0 }, mi_cmd_list_thread_groups },  
+  { "remove-inferior", { NULL, 0 }, mi_cmd_remove_inferior },
   { "stack-info-depth", { NULL, 0 }, mi_cmd_stack_info_depth},
   { "stack-info-frame", { NULL, 0 }, mi_cmd_stack_info_frame},
   { "stack-list-arguments", { NULL, 0 }, mi_cmd_stack_list_args},
   { "stack-list-frames", { NULL, 0 }, mi_cmd_stack_list_frames},
   { "stack-list-locals", { NULL, 0 }, mi_cmd_stack_list_locals},
+  { "stack-list-variables", { NULL, 0 }, mi_cmd_stack_list_variables},
   { "stack-select-frame", { NULL, 0 }, mi_cmd_stack_select_frame},
   { "symbol-list-lines", { NULL, 0 }, mi_cmd_symbol_list_lines},
   { "target-attach", { "attach", 1 }, NULL },
@@ -100,6 +114,13 @@ struct mi_cmd mi_cmds[] =
   { "thread-info", { NULL, 0 }, mi_cmd_thread_info },
   { "thread-list-ids", { NULL, 0 }, mi_cmd_thread_list_ids},
   { "thread-select", { NULL, 0 }, mi_cmd_thread_select},
+  { "trace-define-variable", { NULL, 0 }, mi_cmd_trace_define_variable },
+  { "trace-find", { NULL, 0 }, mi_cmd_trace_find },
+  { "trace-list-variables", { NULL, 0 }, mi_cmd_trace_list_variables },
+  { "trace-save", { NULL, 0 }, mi_cmd_trace_save },
+  { "trace-start", { NULL, 0 }, mi_cmd_trace_start },
+  { "trace-status", { NULL, 0 }, mi_cmd_trace_status },
+  { "trace-stop", { NULL, 0 }, mi_cmd_trace_stop },
   { "var-assign", { NULL, 0 }, mi_cmd_var_assign},
   { "var-create", { NULL, 0 }, mi_cmd_var_create},
   { "var-delete", { NULL, 0 }, mi_cmd_var_delete},
@@ -111,6 +132,7 @@ struct mi_cmd mi_cmds[] =
   { "var-list-children", { NULL, 0 }, mi_cmd_var_list_children},
   { "var-set-format", { NULL, 0 }, mi_cmd_var_set_format},
   { "var-set-frozen", { NULL, 0 }, mi_cmd_var_set_frozen},
+  { "var-set-update-range", { NULL, 0 }, mi_cmd_var_set_update_range },
   { "var-set-visualizer", { NULL, 0 }, mi_cmd_var_set_visualizer},
   { "var-show-attributes", { NULL, 0 }, mi_cmd_var_show_attributes},
   { "var-show-format", { NULL, 0 }, mi_cmd_var_show_format},
@@ -118,24 +140,25 @@ struct mi_cmd mi_cmds[] =
   { NULL, }
 };
 
-/* Pointer to the mi command table (built at run time) */
+/* Pointer to the mi command table (built at run time). */
 
 static struct mi_cmd **mi_table;
 
-/* A prime large enough to accomodate the entire command table */
+/* A prime large enough to accomodate the entire command table */
 enum
   {
     MI_TABLE_SIZE = 227
   };
 
-/* Exported function used to obtain info from the table */
+/* Exported function used to obtain info from the table */
 struct mi_cmd *
 mi_lookup (const char *command)
 {
   return *lookup_table (command);
 }
 
-/* stat collecting */
+/* Used for collecting hash hit/miss statistics.  */
+
 struct mi_cmd_stats
 {
   int hit;
@@ -144,19 +167,21 @@ struct mi_cmd_stats
 };
 struct mi_cmd_stats stats;
 
-/* our lookup function */
+/* Look up a command.  */
+
 static struct mi_cmd **
 lookup_table (const char *command)
 {
   const char *chp;
   unsigned int index = 0;
-  /* compute our hash */
+
+  /* Compute our hash.  */
   for (chp = command; *chp; chp++)
     {
-      /* some what arbitrary */
+      /* We use a somewhat arbitrary formula.  */
       index = ((index << 6) + (unsigned int) *chp) % MI_TABLE_SIZE;
     }
-  /* look it up */
+
   while (1)
     {
       struct mi_cmd **entry = &mi_table[index];
@@ -189,11 +214,13 @@ build_table (struct mi_cmd *commands)
   for (command = commands; command->name != 0; command++)
     {
       struct mi_cmd **entry = lookup_table (command->name);
+
       if (*entry)
        internal_error (__FILE__, __LINE__,
                        _("command `%s' appears to be duplicated"),
                        command->name);
       *entry = command;
+      /* FIXME lose these prints */
       if (0)
        {
          fprintf_unfiltered (gdb_stdlog, "%-30s %2d\n",
This page took 0.033946 seconds and 4 git commands to generate.