summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2001-06-18 17:57:43 +0000
committerAndrew Cagney <cagney@redhat.com>2001-06-18 17:57:43 +0000
commitf15b3135fe08cb545a238c8e89bab9562bb46d59 (patch)
treea03cbd2b7d9d5b72977845b4fbc79d2ece532953
parent28ac158ebcd63ac09d64b3e2b865eeb956b96717 (diff)
downloadgdb-f15b3135fe08cb545a238c8e89bab9562bb46d59.tar.gz
Recognize -i=mi0, -i=mi1 and -i=mi.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/breakpoint.c24
-rw-r--r--gdb/infrun.c12
-rw-r--r--gdb/mi/ChangeLog11
-rw-r--r--gdb/mi/mi-main.c56
-rw-r--r--gdb/mi/mi-out.c4
-rw-r--r--gdb/mi/mi-out.h2
-rw-r--r--gdb/testsuite/gdb.mi/ChangeLog-mi14
-rw-r--r--gdb/testsuite/gdb.mi/mi-basics.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-break.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-console.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-disassemble.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-eval.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-hack-cli.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-read-memory.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-regs.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-return.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-simplerun.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-stack.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-stepi.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-until.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-block.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-child.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-cmd.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-display.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi-watch.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-basics.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-break.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-console.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-disassemble.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-eval.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-hack-cli.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-read-memory.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-regs.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-return.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-simplerun.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-stack.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-stepi.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-until.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-var-block.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-var-child.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-var-cmd.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-var-display.exp1
-rw-r--r--gdb/testsuite/gdb.mi/mi0-watch.exp1
44 files changed, 125 insertions, 39 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5872332d812..a0614d75e70 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2001-06-18 Andrew Cagney <ac131313@redhat.com>
+
+ * infrun.c, breakpoint.c: Use strncmp as the "mi" test. Allow,
+ "mi", "mi0" and "mi1".
+
2001-06-17 Andrew Cagney <ac131313@redhat.com>
* gdbarch.sh: Generate an error when conflicting macro
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 6824e388ac4..be5450be6fe 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1889,7 +1889,7 @@ print_it_typical (bpstat bs)
#ifdef UI_OUT
annotate_breakpoint (bs->breakpoint_at->number);
ui_out_text (uiout, "\nBreakpoint ");
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "breakpoint-hit");
ui_out_field_int (uiout, "bkptno", bs->breakpoint_at->number);
ui_out_text (uiout, ", ");
@@ -2034,7 +2034,7 @@ print_it_typical (bpstat bs)
{
annotate_watchpoint (bs->breakpoint_at->number);
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "watchpoint-trigger");
mention (bs->breakpoint_at);
ui_out_tuple_begin (uiout, "value");
@@ -2064,7 +2064,7 @@ print_it_typical (bpstat bs)
case bp_read_watchpoint:
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "read-watchpoint-trigger");
mention (bs->breakpoint_at);
ui_out_tuple_begin (uiout, "value");
@@ -2088,7 +2088,7 @@ print_it_typical (bpstat bs)
if (bs->old_val != NULL)
{
annotate_watchpoint (bs->breakpoint_at->number);
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
mention (bs->breakpoint_at);
ui_out_tuple_begin (uiout, "value");
@@ -2102,7 +2102,7 @@ print_it_typical (bpstat bs)
else
{
mention (bs->breakpoint_at);
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
ui_out_tuple_begin (uiout, "value");
ui_out_text (uiout, "\nValue = ");
@@ -2139,7 +2139,7 @@ print_it_typical (bpstat bs)
case bp_finish:
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "function-finished");
#endif
return PRINT_UNKNOWN;
@@ -2147,7 +2147,7 @@ print_it_typical (bpstat bs)
case bp_until:
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "location-reached");
#endif
return PRINT_UNKNOWN;
@@ -2354,7 +2354,7 @@ watchpoint_check (PTR p)
will be deleted already. So we have no choice but print the
information here. */
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "watchpoint-scope");
ui_out_text (uiout, "\nWatchpoint ");
ui_out_field_int (uiout, "wpnum", bs->breakpoint_at->number);
@@ -3476,7 +3476,7 @@ print_one_breakpoint (struct breakpoint *b,
#ifdef UI_OUT
/* Output the count also if it is zero, but only if this is
mi. FIXME: Should have a better test for this. */
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
if (show_breakpoint_hit_counts && b->hit_count == 0)
ui_out_field_int (uiout, "times", b->hit_count);
#endif
@@ -4476,7 +4476,7 @@ mention (struct breakpoint *b)
#endif
case bp_breakpoint:
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
{
say_where = 0;
break;
@@ -4487,7 +4487,7 @@ mention (struct breakpoint *b)
break;
case bp_hardware_breakpoint:
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
{
say_where = 0;
break;
@@ -4550,7 +4550,7 @@ mention (struct breakpoint *b)
do_cleanups (old_chain);
#endif
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
return;
#endif
printf_filtered ("\n");
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 9f2daef2c92..ba623338438 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -3334,7 +3334,7 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
/* Print a message only if not in the middle of doing a "step n"
operation for n > 1 */
if (!step_multi || !stop_step)
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "end-stepping-range");
#endif
break;
@@ -3346,7 +3346,7 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
/* The inferior was terminated by a signal. */
#ifdef UI_OUT
annotate_signalled ();
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "exited-signalled");
ui_out_text (uiout, "\nProgram terminated with signal ");
annotate_signal_name ();
@@ -3380,7 +3380,7 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
annotate_exited (stop_info);
if (stop_info)
{
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "exited");
ui_out_text (uiout, "\nProgram exited with code ");
ui_out_field_fmt (uiout, "exit-code", "0%o", (unsigned int) stop_info);
@@ -3388,7 +3388,7 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
}
else
{
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "exited-normally");
ui_out_text (uiout, "\nProgram exited normally.\n");
}
@@ -3574,12 +3574,12 @@ and/or watchpoints.\n");
#ifdef UI_OUT
/* For mi, have the same behavior every time we stop:
print everything but the source line. */
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
source_flag = LOC_AND_ADDRESS;
#endif
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_int (uiout, "thread-id",
pid_to_thread_id (inferior_ptid));
#endif
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index 6c1eb42fa86..e9b604942ed 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,3 +1,14 @@
+2001-06-18 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c: Use strncmp as the "mi" test. Allow "mi", "mi0" and
+ "mi1".
+ (mi_command_loop): Add parameter mi_version, pass to mi_out_new.
+ (mi1_command_loop, mi0_command_loop): New functions.
+ (_initialize_mi_main): Recognize "mi", "mi0" and "mi1".
+ * mi-out.c (mi_out_new): Add parameter mi_version.
+ (struct ui_out_data): Add field mi_version.
+ * mi-out.h (mi_out_new): Update.
+
2001-06-07 Andrew Cagney <ac131313@redhat.com>
* gdbmi.texinfo (GDB/MI Output Syntax): Add tuples and lists to
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index c7476cd5916..5f73ddf85f9 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -1351,7 +1351,7 @@ mi_load_progress (const char *section_name,
static char *previous_sect_name = NULL;
int new_section;
- if (!interpreter_p || strcmp (interpreter_p, "mi") != 0)
+ if (!interpreter_p || strncmp (interpreter_p, "mi", 2) != 0)
return;
update_threshold.tv_sec = 0;
@@ -1409,7 +1409,7 @@ mi_load_progress (const char *section_name,
}
static void
-mi_command_loop (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
@@ -1425,7 +1425,7 @@ mi_command_loop (void)
/* 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 ();
+ uiout = mi_out_new (mi_version);
/* HACK: Override any other interpreter hooks. We need to create a
real event table and pass in that. */
@@ -1465,6 +1465,18 @@ mi_command_loop (void)
}
static void
+mi0_command_loop (void)
+{
+ mi_command_loop (0);
+}
+
+static void
+mi1_command_loop (void)
+{
+ mi_command_loop (1);
+}
+
+static void
setup_architecture_data (void)
{
/* don't trust REGISTER_BYTES to be zero. */
@@ -1482,24 +1494,30 @@ mi_init_ui (char *arg0)
void
_initialize_mi_main (void)
{
+ if (interpreter_p == NULL)
+ return;
+
/* If we're _the_ interpreter, take control. */
- if (interpreter_p
- && strcmp (interpreter_p, "mi") == 0)
+ if (strcmp (interpreter_p, "mi0") == 0)
+ command_loop_hook = mi0_command_loop;
+ else if (strcmp (interpreter_p, "mi") == 0
+ || strcmp (interpreter_p, "mi1") == 0)
+ command_loop_hook = mi1_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, setup_architecture_data);
+ if (event_loop_p)
{
- init_ui_hook = mi_init_ui;
- command_loop_hook = mi_command_loop;
- setup_architecture_data ();
- register_gdbarch_swap (&old_regs, sizeof (old_regs), NULL);
- register_gdbarch_swap (NULL, 0, setup_architecture_data);
- if (event_loop_p)
- {
- /* These overwrite some of the initialization done in
- _intialize_event_loop. */
- call_readline = gdb_readline2;
- input_handler = mi_execute_command_wrapper;
- add_file_handler (input_fd, stdin_event_handler, 0);
- async_command_editing_p = 0;
- }
+ /* These overwrite some of the initialization done in
+ _intialize_event_loop. */
+ call_readline = gdb_readline2;
+ input_handler = mi_execute_command_wrapper;
+ add_file_handler (input_fd, stdin_event_handler, 0);
+ async_command_editing_p = 0;
}
/* FIXME: Should we notify main that we are here as a possible
interpreter? */
diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c
index 0e0ac3f61c8..034d3c1f166 100644
--- a/gdb/mi/mi-out.c
+++ b/gdb/mi/mi-out.c
@@ -33,6 +33,7 @@ struct ui_out_data
{
int suppress_field_separator;
int first_header;
+ int mi_version;
struct ui_file *buffer;
};
@@ -379,11 +380,12 @@ mi_out_put (struct ui_out *uiout,
/* initalize private members at startup */
struct ui_out *
-mi_out_new (void)
+mi_out_new (int mi_version)
{
int flags = 0;
struct ui_out_data *data = XMALLOC (struct ui_out_data);
data->suppress_field_separator = 0;
+ data->mi_version = mi_version;
/* FIXME: This code should be using a ``string_file'' and not the
TUI buffer hack. */
data->buffer = mem_fileopen ();
diff --git a/gdb/mi/mi-out.h b/gdb/mi/mi-out.h
index 37a643ca638..1ae693f4761 100644
--- a/gdb/mi/mi-out.h
+++ b/gdb/mi/mi-out.h
@@ -25,7 +25,7 @@
struct ui_out;
struct ui_file;
-extern struct ui_out *mi_out_new (void);
+extern struct ui_out *mi_out_new (int mi_version);
extern void mi_out_put (struct ui_out *uiout, struct ui_file *stream);
extern void mi_out_rewind (struct ui_out *uiout);
extern void mi_out_buffered (struct ui_out *uiout, char *string);
diff --git a/gdb/testsuite/gdb.mi/ChangeLog-mi b/gdb/testsuite/gdb.mi/ChangeLog-mi
index 4349d09a87b..0c1e353ce01 100644
--- a/gdb/testsuite/gdb.mi/ChangeLog-mi
+++ b/gdb/testsuite/gdb.mi/ChangeLog-mi
@@ -1,3 +1,17 @@
+2001-06-18 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-basics.exp, mi-break.exp, mi-console.exp, mi-disassemble.exp,
+ mi-eval.exp, mi-hack-cli.exp, mi-read-memory.exp, mi-regs.exp,
+ mi-return.exp, mi-simplerun.exp, mi-stack.exp, mi-stepi.exp,
+ mi-until.exp, mi-var-block.exp, mi-var-child.exp, mi-var-cmd.exp,
+ mi-var-display.exp, mi-watch.exp, mi0-basics.exp, mi0-break.exp,
+ mi0-console.exp, mi0-disassemble.exp, mi0-eval.exp,
+ mi0-hack-cli.exp, mi0-read-memory.exp, mi0-regs.exp,
+ mi0-return.exp, mi0-simplerun.exp, mi0-stack.exp, mi0-stepi.exp,
+ mi0-until.exp, mi0-var-block.exp, mi0-var-child.exp,
+ mi0-var-cmd.exp, mi0-var-display.exp, mi0-watch.exp: Use MIFLAGS
+ to explictly select an interpreter.
+
2001-06-16 Andrew Cagney <ac131313@redhat.com>
MI0 was the never enabled MI interface included in GDB 5.0.
diff --git a/gdb/testsuite/gdb.mi/mi-basics.exp b/gdb/testsuite/gdb.mi/mi-basics.exp
index 41ce7925269..85d9924ad04 100644
--- a/gdb/testsuite/gdb.mi/mi-basics.exp
+++ b/gdb/testsuite/gdb.mi/mi-basics.exp
@@ -30,6 +30,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp
index 8ac38ea0a61..d2df948c1a8 100644
--- a/gdb/testsuite/gdb.mi/mi-break.exp
+++ b/gdb/testsuite/gdb.mi/mi-break.exp
@@ -29,6 +29,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-console.exp b/gdb/testsuite/gdb.mi/mi-console.exp
index 04ee84166b9..7b7a7062c5d 100644
--- a/gdb/testsuite/gdb.mi/mi-console.exp
+++ b/gdb/testsuite/gdb.mi/mi-console.exp
@@ -33,6 +33,7 @@
# remote target.
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-disassemble.exp b/gdb/testsuite/gdb.mi/mi-disassemble.exp
index 75f097d1f7e..a1325d6f334 100644
--- a/gdb/testsuite/gdb.mi/mi-disassemble.exp
+++ b/gdb/testsuite/gdb.mi/mi-disassemble.exp
@@ -25,6 +25,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-eval.exp b/gdb/testsuite/gdb.mi/mi-eval.exp
index 542d31dc9b8..780605b67aa 100644
--- a/gdb/testsuite/gdb.mi/mi-eval.exp
+++ b/gdb/testsuite/gdb.mi/mi-eval.exp
@@ -27,6 +27,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-hack-cli.exp b/gdb/testsuite/gdb.mi/mi-hack-cli.exp
index 44b7ff3ba62..98ee5045244 100644
--- a/gdb/testsuite/gdb.mi/mi-hack-cli.exp
+++ b/gdb/testsuite/gdb.mi/mi-hack-cli.exp
@@ -21,6 +21,7 @@
# Some basic checks for the CLI.
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-read-memory.exp b/gdb/testsuite/gdb.mi/mi-read-memory.exp
index 871b1295f4f..a7b2a1a1088 100644
--- a/gdb/testsuite/gdb.mi/mi-read-memory.exp
+++ b/gdb/testsuite/gdb.mi/mi-read-memory.exp
@@ -30,6 +30,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-regs.exp b/gdb/testsuite/gdb.mi/mi-regs.exp
index 089b7679fae..808c087caa0 100644
--- a/gdb/testsuite/gdb.mi/mi-regs.exp
+++ b/gdb/testsuite/gdb.mi/mi-regs.exp
@@ -27,6 +27,7 @@
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-return.exp b/gdb/testsuite/gdb.mi/mi-return.exp
index 57ea05ed25e..81680a43a87 100644
--- a/gdb/testsuite/gdb.mi/mi-return.exp
+++ b/gdb/testsuite/gdb.mi/mi-return.exp
@@ -27,6 +27,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-simplerun.exp b/gdb/testsuite/gdb.mi/mi-simplerun.exp
index 636f60dbcca..d5b528db78a 100644
--- a/gdb/testsuite/gdb.mi/mi-simplerun.exp
+++ b/gdb/testsuite/gdb.mi/mi-simplerun.exp
@@ -29,6 +29,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-stack.exp b/gdb/testsuite/gdb.mi/mi-stack.exp
index 045e981bc16..1ec987a6abf 100644
--- a/gdb/testsuite/gdb.mi/mi-stack.exp
+++ b/gdb/testsuite/gdb.mi/mi-stack.exp
@@ -27,6 +27,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-stepi.exp b/gdb/testsuite/gdb.mi/mi-stepi.exp
index a67d74248a4..23387d47630 100644
--- a/gdb/testsuite/gdb.mi/mi-stepi.exp
+++ b/gdb/testsuite/gdb.mi/mi-stepi.exp
@@ -27,6 +27,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-until.exp b/gdb/testsuite/gdb.mi/mi-until.exp
index cf3c21df1d2..13c73e38bbf 100644
--- a/gdb/testsuite/gdb.mi/mi-until.exp
+++ b/gdb/testsuite/gdb.mi/mi-until.exp
@@ -27,6 +27,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-var-block.exp b/gdb/testsuite/gdb.mi/mi-var-block.exp
index 539a58def6a..0b9ebc32d73 100644
--- a/gdb/testsuite/gdb.mi/mi-var-block.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-block.exp
@@ -24,6 +24,7 @@
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-var-child.exp b/gdb/testsuite/gdb.mi/mi-var-child.exp
index 6ac6e6b170f..1d77df5b4cd 100644
--- a/gdb/testsuite/gdb.mi/mi-var-child.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-child.exp
@@ -24,6 +24,7 @@
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
index f1fcedd26f4..a9ae101d215 100644
--- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
@@ -24,6 +24,7 @@
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp
index 4f231d032f3..f57280b87fd 100644
--- a/gdb/testsuite/gdb.mi/mi-var-display.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-display.exp
@@ -24,6 +24,7 @@
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp
index 5b8908a8784..04c2b9f186c 100644
--- a/gdb/testsuite/gdb.mi/mi-watch.exp
+++ b/gdb/testsuite/gdb.mi/mi-watch.exp
@@ -29,6 +29,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-basics.exp b/gdb/testsuite/gdb.mi/mi0-basics.exp
index 41ce7925269..a64fdf20cb4 100644
--- a/gdb/testsuite/gdb.mi/mi0-basics.exp
+++ b/gdb/testsuite/gdb.mi/mi0-basics.exp
@@ -30,6 +30,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-break.exp b/gdb/testsuite/gdb.mi/mi0-break.exp
index 8ac38ea0a61..fdad674edb3 100644
--- a/gdb/testsuite/gdb.mi/mi0-break.exp
+++ b/gdb/testsuite/gdb.mi/mi0-break.exp
@@ -29,6 +29,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-console.exp b/gdb/testsuite/gdb.mi/mi0-console.exp
index 04ee84166b9..3e03fcf9dae 100644
--- a/gdb/testsuite/gdb.mi/mi0-console.exp
+++ b/gdb/testsuite/gdb.mi/mi0-console.exp
@@ -33,6 +33,7 @@
# remote target.
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-disassemble.exp b/gdb/testsuite/gdb.mi/mi0-disassemble.exp
index 75f097d1f7e..deddf4b94a5 100644
--- a/gdb/testsuite/gdb.mi/mi0-disassemble.exp
+++ b/gdb/testsuite/gdb.mi/mi0-disassemble.exp
@@ -25,6 +25,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-eval.exp b/gdb/testsuite/gdb.mi/mi0-eval.exp
index 542d31dc9b8..ff41510a81c 100644
--- a/gdb/testsuite/gdb.mi/mi0-eval.exp
+++ b/gdb/testsuite/gdb.mi/mi0-eval.exp
@@ -27,6 +27,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-hack-cli.exp b/gdb/testsuite/gdb.mi/mi0-hack-cli.exp
index 44b7ff3ba62..f8109bc23b0 100644
--- a/gdb/testsuite/gdb.mi/mi0-hack-cli.exp
+++ b/gdb/testsuite/gdb.mi/mi0-hack-cli.exp
@@ -21,6 +21,7 @@
# Some basic checks for the CLI.
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-read-memory.exp b/gdb/testsuite/gdb.mi/mi0-read-memory.exp
index 871b1295f4f..bf344fc68c1 100644
--- a/gdb/testsuite/gdb.mi/mi0-read-memory.exp
+++ b/gdb/testsuite/gdb.mi/mi0-read-memory.exp
@@ -30,6 +30,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-regs.exp b/gdb/testsuite/gdb.mi/mi0-regs.exp
index 089b7679fae..c91869378dc 100644
--- a/gdb/testsuite/gdb.mi/mi0-regs.exp
+++ b/gdb/testsuite/gdb.mi/mi0-regs.exp
@@ -27,6 +27,7 @@
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-return.exp b/gdb/testsuite/gdb.mi/mi0-return.exp
index 57ea05ed25e..5f3b58596e5 100644
--- a/gdb/testsuite/gdb.mi/mi0-return.exp
+++ b/gdb/testsuite/gdb.mi/mi0-return.exp
@@ -27,6 +27,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-simplerun.exp b/gdb/testsuite/gdb.mi/mi0-simplerun.exp
index 636f60dbcca..55c699c9bf0 100644
--- a/gdb/testsuite/gdb.mi/mi0-simplerun.exp
+++ b/gdb/testsuite/gdb.mi/mi0-simplerun.exp
@@ -29,6 +29,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-stack.exp b/gdb/testsuite/gdb.mi/mi0-stack.exp
index 045e981bc16..ebed25d676d 100644
--- a/gdb/testsuite/gdb.mi/mi0-stack.exp
+++ b/gdb/testsuite/gdb.mi/mi0-stack.exp
@@ -27,6 +27,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-stepi.exp b/gdb/testsuite/gdb.mi/mi0-stepi.exp
index a67d74248a4..def2134d09e 100644
--- a/gdb/testsuite/gdb.mi/mi0-stepi.exp
+++ b/gdb/testsuite/gdb.mi/mi0-stepi.exp
@@ -27,6 +27,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-until.exp b/gdb/testsuite/gdb.mi/mi0-until.exp
index cf3c21df1d2..12c711e9e38 100644
--- a/gdb/testsuite/gdb.mi/mi0-until.exp
+++ b/gdb/testsuite/gdb.mi/mi0-until.exp
@@ -27,6 +27,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-var-block.exp b/gdb/testsuite/gdb.mi/mi0-var-block.exp
index 539a58def6a..d0f69b841b8 100644
--- a/gdb/testsuite/gdb.mi/mi0-var-block.exp
+++ b/gdb/testsuite/gdb.mi/mi0-var-block.exp
@@ -24,6 +24,7 @@
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-var-child.exp b/gdb/testsuite/gdb.mi/mi0-var-child.exp
index 6ac6e6b170f..e5c62c90390 100644
--- a/gdb/testsuite/gdb.mi/mi0-var-child.exp
+++ b/gdb/testsuite/gdb.mi/mi0-var-child.exp
@@ -24,6 +24,7 @@
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-var-cmd.exp b/gdb/testsuite/gdb.mi/mi0-var-cmd.exp
index f1fcedd26f4..ed48e5e5645 100644
--- a/gdb/testsuite/gdb.mi/mi0-var-cmd.exp
+++ b/gdb/testsuite/gdb.mi/mi0-var-cmd.exp
@@ -24,6 +24,7 @@
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-var-display.exp b/gdb/testsuite/gdb.mi/mi0-var-display.exp
index 4f231d032f3..ee29d433b8c 100644
--- a/gdb/testsuite/gdb.mi/mi0-var-display.exp
+++ b/gdb/testsuite/gdb.mi/mi0-var-display.exp
@@ -24,6 +24,7 @@
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi0-watch.exp b/gdb/testsuite/gdb.mi/mi0-watch.exp
index 5b8908a8784..c66cbb5b877 100644
--- a/gdb/testsuite/gdb.mi/mi0-watch.exp
+++ b/gdb/testsuite/gdb.mi/mi0-watch.exp
@@ -29,6 +29,7 @@
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {