]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2002-11-04 Elena Zannoni <ezannoni@redhat.com>
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Mon, 4 Nov 2002 16:18:02 +0000 (16:18 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Mon, 4 Nov 2002 16:18:02 +0000 (16:18 +0000)
* interps.h (GDB_INTERPRETER_MI2): Define.
(GDB_INTERPRETER_MI0): Remove.

2002-11-04  Elena Zannoni  <ezannoni@redhat.com>

* mi-interp.c: Increment mi version numbers: 0->1, 1->2,
and 2->3. Remove MI0 references.
* mi-events.c: Ditto.
* mi-main.c: Ditto. Remove erroneously merged code.
* mi.h: Ditto.

gdb/ChangeLog
gdb/interps.h
gdb/mi/ChangeLog
gdb/mi/mi-events.c
gdb/mi/mi-interp.c
gdb/mi/mi-main.c
gdb/mi/mi.h

index 0dd7b517777efe0247c2ca9998c54250cd36cade..de369a9ad8fc9f170c20cee67fc3310eb05db917 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-04  Elena Zannoni  <ezannoni@redhat.com>
+
+       * interps.h (GDB_INTERPRETER_MI2): Define.
+       (GDB_INTERPRETER_MI0): Remove.
+
 2002-10-01  Keith Seitz  <keiths@redhat.com>
 
        * interps.c (interpreter_exec_cmd): Remove mention of "mi" in
index b4577158edf27a85e0223ac320cb34753403d37d..297bed1c5c7ce151aef894cf821609f00296719f 100644 (file)
@@ -70,7 +70,7 @@ void clear_interpreter_hooks ();
 
 /* well-known interpreters */
 #define GDB_INTERPRETER_CONSOLE                "console"
-#define GDB_INTERPRETER_MI0            "mi0"
 #define GDB_INTERPRETER_MI1             "mi1"
+#define GDB_INTERPRETER_MI2            "mi2"
 #define GDB_INTERPRETER_MI             "mi"
 #endif /* GDB_INTERPRETER_H */
index 3a59321263d642973cb7f398824b1607d0faed1a..9d3dd9f0876da26f0cf920fff3cd0337062df571 100644 (file)
@@ -1,3 +1,11 @@
+2002-11-04  Elena Zannoni  <ezannoni@redhat.com>
+
+       * mi-interp.c: Increment mi version numbers: 0->1, 1->2,
+       and 2->3. Remove MI0 references.
+       * mi-events.c: Ditto.
+       * mi-main.c: Ditto. Remove erroneously merged code.
+       * mi.h: Ditto.
+       
 2002-08-28  Keith Seitz  <keiths@redhat.com>
 
        * mi-interp.c (_initialize_mi_interp): Add exec_proc.
index d63e578d7d36e14df67e671c3b9ea03f86cfadba..5dc4b26dada7063882e38bff91310b88315be440 100644 (file)
@@ -32,8 +32,8 @@ mi_interp_stack_changed_hook (void)
   struct ui_out *saved_ui_out = uiout;
   struct mi_out *tmp_mi_out;
 
-  if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0))
-    uiout = gdb_interpreter_ui_out (mi0_interp);
+  if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1))
+    uiout = gdb_interpreter_ui_out (mi1_interp);
   else
     uiout = gdb_interpreter_ui_out (mi_interp);
 
@@ -48,8 +48,8 @@ event_notify (const char *string, ...)
 {
   va_list args;
 
-  if (!gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0)
-      && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1))
+  if (!gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1)
+      && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI2))
     {
       va_start (args, string);
       vfprintf_unfiltered (mi_event_channel, string, args);
index 52597f290711a190c15db1d5b7826f9250a1bddd..044bc2ed6f11beed7a11959c87aa47431fbaf09c 100644 (file)
@@ -39,7 +39,7 @@ struct ui_file *mi_stdtarg;
 struct ui_file *mi_event_channel;
 
 /* This is the interpreter for the mi... */
-struct gdb_interpreter *mi0_interp;
+struct gdb_interpreter *mi2_interp;
 struct gdb_interpreter *mi1_interp;
 struct gdb_interpreter *mi_interp;
 
@@ -63,7 +63,7 @@ static int mi_interp_query_hook (const char *ctlstr, va_list ap);
 static char *mi_interp_read_one_line_hook (char *prompt, int repeat,
                                           char *anno);
 
-static void mi0_command_loop (void);
+static void mi2_command_loop (void);
 static void mi1_command_loop (void);
 
 static void mi_insert_notify_hooks (void);
@@ -149,12 +149,12 @@ mi_interpreter_resume (void *data)
   show_load_progress = mi_load_progress;
 
   /* If we're _the_ interpreter, take control. */
-  if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0))
-    command_loop_hook = mi0_command_loop;
+  if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI2))
+    command_loop_hook = mi2_command_loop;
   else if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1))
     command_loop_hook = mi1_command_loop;
   else if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI))
-    command_loop_hook = mi1_command_loop;
+    command_loop_hook = mi2_command_loop;
   else
     return 0;
 
@@ -352,15 +352,15 @@ mi_execute_command_wrapper (char *cmd)
 }
 
 static void
-mi0_command_loop (void)
+mi1_command_loop (void)
 {
-  mi_command_loop (0);
+  mi_command_loop (1);
 }
 
 static void
-mi1_command_loop (void)
+mi2_command_loop (void)
 {
-  mi_command_loop (1);
+  mi_command_loop (2);
 }
 
 static void
@@ -437,19 +437,6 @@ _initialize_mi_interp (void)
       mi_interpreter_prompt    /* prompt_proc */
     };
 
-  /* Create MI0 interpreter */
-  if (mi0_interp == NULL)
-    {
-      mi0_interp =
-       gdb_new_interpreter (GDB_INTERPRETER_MI0, NULL, mi_out_new (0),
-                            &procs);
-      if (mi0_interp == NULL)
-       error
-         ("Couldn't allocate a new interpreter for the mi0 interpreter\n");
-      if (gdb_add_interpreter (mi0_interp) != 1)
-       error ("Couldn't add the mi0 interpreter to gdb.\n");
-    }
-
   /* Create MI1 interpreter */
   if (mi1_interp == NULL)
     {
@@ -464,10 +451,23 @@ _initialize_mi_interp (void)
     }
 
   /* Create MI2 interpreter */
+  if (mi2_interp == NULL)
+    {
+      mi2_interp =
+       gdb_new_interpreter (GDB_INTERPRETER_MI2, NULL, mi_out_new (2),
+                            &procs);
+      if (mi2_interp == NULL)
+       error
+         ("Couldn't allocate a new interpreter for the mi2 interpreter\n");
+      if (gdb_add_interpreter (mi2_interp) != 1)
+       error ("Couldn't add the mi2 interpreter to gdb.\n");
+    }
+
+  /* Create MI3 interpreter */
   if (mi_interp == NULL)
     {
       mi_interp =
-       gdb_new_interpreter (GDB_INTERPRETER_MI, NULL, mi_out_new (2),
+       gdb_new_interpreter (GDB_INTERPRETER_MI, NULL, mi_out_new (3),
                             &procs);
       if (mi_interp == NULL)
        error
index 5e2f4cc08c9cef355cd2147e4337bf222b4adcc8..f317910f02fb2a197876e55cdad2330f8fc42256 100644 (file)
@@ -1161,8 +1161,8 @@ captured_mi_execute_command (struct ui_out *uiout, void *data)
 
       /* If we changed interpreters, DON'T print out anything. */
       if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI)
-         || gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0)
-         || gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1))
+         || gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1)
+         || gdb_current_interpreter_is_named (GDB_INTERPRETER_MI2))
        {
          /* print the result */
          /* FIXME: Check for errors here. */
@@ -1411,8 +1411,8 @@ mi_load_progress (const char *section_name,
   int new_section;
 
   if (!gdb_current_interpreter_is_named (GDB_INTERPRETER_MI)
-      && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0)
-      && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1))
+      && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1)
+      && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI2))
     return;
 
   update_threshold.tv_sec = 0;
@@ -1471,77 +1471,8 @@ mi_load_progress (const char *section_name,
     }
 }
 
-static void
-mi_command_loop (int mi_version)
-{
-  /* HACK: Force stdout/stderr to point at the console.  This avoids
-     any potential side effects caused by legacy code that is still
-     using the TUI / fputs_unfiltered_hook */
-  raw_stdout = stdio_fileopen (stdout);
-  /* Route normal output through the MIx */
-  gdb_stdout = mi_console_file_new (raw_stdout, "~");
-  /* Route error and log output through the MI */
-  gdb_stderr = mi_console_file_new (raw_stdout, "&");
-  gdb_stdlog = gdb_stderr;
-  /* Route target output through the MI. */
-  gdb_stdtarg = mi_console_file_new (raw_stdout, "@");
-
-  /* HACK: Poke the ui_out table directly.  Should we be creating a
-     mi_out object wired up to the above gdb_stdout / gdb_stderr? */
-  uiout = mi_out_new (mi_version);
-
-  /* HACK: Override any other interpreter hooks.  We need to create a
-     real event table and pass in that. */
-  init_ui_hook = 0;
-  /* command_loop_hook = 0; */
-  print_frame_info_listing_hook = 0;
-  query_hook = 0;
-  warning_hook = 0;
-  create_breakpoint_hook = 0;
-  delete_breakpoint_hook = 0;
-  modify_breakpoint_hook = 0;
-  interactive_hook = 0;
-  registers_changed_hook = 0;
-  readline_begin_hook = 0;
-  readline_hook = 0;
-  readline_end_hook = 0;
-  register_changed_hook = 0;
-  memory_changed_hook = 0;
-  context_hook = 0;
-  target_wait_hook = 0;
-  call_command_hook = 0;
-  error_hook = 0;
-  error_begin_hook = 0;
-  show_load_progress = mi_load_progress;
-
-  /* Turn off 8 bit strings in quoted output.  Any character with the
-     high bit set is printed using C's octal format. */
-  sevenbit_strings = 1;
-
-  /* Tell the world that we're alive */
-  fputs_unfiltered ("(gdb) \n", raw_stdout);
-  gdb_flush (raw_stdout);
-
-  if (!event_loop_p)
-    simplified_command_loop (mi_input, mi_execute_command);
-  else
-    start_event_loop ();
-}
-
-static void
-mi1_command_loop (void)
-{
-  mi_command_loop (1);
-}
-
-static void
-mi2_command_loop (void)
-{
-  mi_command_loop (2);
-}
-
-static void
-setup_architecture_data (void)
+void
+mi_setup_architecture_data (void)
 {
   /* don't trust REGISTER_BYTES to be zero. */
   old_regs = xmalloc (REGISTER_BYTES + 1);
@@ -1551,21 +1482,6 @@ setup_architecture_data (void)
 void
 mi_register_gdbarch_swap (void)
 {
-  if (interpreter_p == NULL)
-    return;
-
-  /* If we're _the_ interpreter, take control. */
-  if (strcmp (interpreter_p, "mi") == 0)
-    command_loop_hook = mi2_command_loop;
-  else if (strcmp (interpreter_p, "mi1") == 0)
-    command_loop_hook = mi1_command_loop;
-  else if (strcmp (interpreter_p, "mi2") == 0)
-    command_loop_hook = mi2_command_loop;
-  else
-    return;
-
-  init_ui_hook = mi_init_ui;
-  setup_architecture_data ();
   register_gdbarch_swap (&old_regs, sizeof (old_regs), NULL);
   register_gdbarch_swap (NULL, 0, mi_setup_architecture_data);
 }
index 0fbf2cdd5bfd5a9bc424b2016dd5c680e9b0ad17..be4e63344d88bc9402f520f03284dee19fbaada7 100644 (file)
@@ -25,7 +25,7 @@ struct ui_file;
 struct breakpoint;
 struct gdb_interpreter;
 extern struct gdb_interpreter *mi_interp;
-extern struct gdb_interpreter *mi0_interp;
+extern struct gdb_interpreter *mi1_interp;
 
 extern void mi_setup_architecture_data (void);
 extern void mi_register_gdbarch_swap (void);