* 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".
+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.
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");
+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".
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);
/* 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;
}
}
static void
+mi3_command_loop (void)
+{
+ mi_command_loop (3);
+}
+
+static void
mi_command_loop (int mi_version)
{
#if 0
/* 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. */