2003-08-08 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Fri, 8 Aug 2003 19:00:08 +0000 (19:00 +0000)
committerAndrew Cagney <cagney@redhat.com>
Fri, 8 Aug 2003 19:00:08 +0000 (19:00 +0000)
* interps.c (interp_set): Check for a NULL "old_interp".

Index: mi/ChangeLog
2003-08-08  Andrew Cagney  <cagney@redhat.com>

* mi-main.c (captured_mi_execute_command): Add "mi2" and "mi3" to
interpreters that hack around CLI.
* mi-interp.c (mi3_command_loop): New function.
(mi_interpreter_resume): Check for "mi3", default to "mi2".

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

index c7685fba75964875f0f6096cf184ca88a99cad21..207eff5467fd8f0e8c61172f7e7f34c63e30acd1 100644 (file)
@@ -1,3 +1,7 @@
+2003-08-08  Andrew Cagney  <cagney@redhat.com>
+
+       * interps.c (interp_set): Check for a NULL "old_interp".
+
 2003-08-08  H.J. Lu  <hongjiu.lu@intel.com>
 
        * Makefile.in (FLAGS_TO_PASS): Add DESTDIR.
index 6df1d4bf17fd36ee6fbe2ce7e3c65b375eb20c2d..82e9af690b13ca687e593a1d014ad4c2245f75dd 100644 (file)
@@ -183,7 +183,7 @@ interp_set (struct interp *interp)
   if (interp->procs->resume_proc != NULL
       && (!interp->procs->resume_proc (interp->data)))
     {
-      if (!interp_set (old_interp))
+      if (old_interp == NULL || !interp_set (old_interp))
        internal_error (__FILE__, __LINE__,
                        "Failed to initialize new interp \"%s\" %s",
                        interp->name, "and could not restore old interp!\n");
index 3122136357de942533bff3d524e330a50b4f1d55..520ad4d718d558178384494e7f95f1fe6e2eecad 100644 (file)
@@ -1,3 +1,10 @@
+2003-08-08  Andrew Cagney  <cagney@redhat.com>
+
+       * mi-main.c (captured_mi_execute_command): Add "mi2" and "mi3" to
+       interpreters that hack around CLI.
+       * mi-interp.c (mi3_command_loop): New function.
+       (mi_interpreter_resume): Check for "mi3", default to "mi2".
+
 2003-08-07  Andrew Cagney  <cagney@redhat.com>
 
        * mi-interp.c (_initialize_mi_interp): Register "mi2" and "mi3".
index e00e32989e46335aeb6adb96d7df2b58365b613c..b72d7ef0bc2b6a97befeb231dcb862a8a2ffde7f 100644 (file)
@@ -60,6 +60,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 mi3_command_loop (void);
 static void mi2_command_loop (void);
 static void mi1_command_loop (void);
 
@@ -133,10 +134,12 @@ mi_interpreter_resume (void *data)
   /* If we're _the_ interpreter, take control. */
   if (current_interp_named_p (INTERP_MI1))
     command_loop_hook = mi1_command_loop;
-  else if (current_interp_named_p (INTERP_MI))
+  else if (current_interp_named_p (INTERP_MI2))
     command_loop_hook = mi2_command_loop;
+  else if (current_interp_named_p (INTERP_MI3))
+    command_loop_hook = mi3_command_loop;
   else
-    return 0;
+    command_loop_hook = mi2_command_loop;
 
   return 1;
 }
@@ -333,6 +336,12 @@ mi2_command_loop (void)
   mi_command_loop (2);
 }
 
+static void
+mi3_command_loop (void)
+{
+  mi_command_loop (3);
+}
+
 static void
 mi_command_loop (int mi_version)
 {
index 29eccaca5f4450512a31e6a93b11263bf5b4ab22..40d3699dc71d8dd5b532271b5fd92a6d80049a61 100644 (file)
@@ -1161,7 +1161,9 @@ captured_mi_execute_command (struct ui_out *uiout, void *data)
 
       /* If we changed interpreters, DON'T print out anything. */
       if (current_interp_named_p (INTERP_MI)
-         || current_interp_named_p (INTERP_MI1))
+         || current_interp_named_p (INTERP_MI1)
+         || current_interp_named_p (INTERP_MI2)
+         || current_interp_named_p (INTERP_MI3))
        {
          /* print the result */
          /* FIXME: Check for errors here. */
This page took 0.03281 seconds and 4 git commands to generate.