aboutsummaryrefslogtreecommitdiff
path: root/gdb
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
commitb30bf9ee99a2fd704f3a335d185041e7432f3105 (patch)
tree8e750381e3675422a8e7a3c5f62141faf912e679 /gdb
parent6f9efd975101f3a93625952de6de81ae36ef8c4b (diff)
downloadgdb-b30bf9ee99a2fd704f3a335d185041e7432f3105.zip
gdb-b30bf9ee99a2fd704f3a335d185041e7432f3105.tar.gz
gdb-b30bf9ee99a2fd704f3a335d185041e7432f3105.tar.bz2
Recognize -i=mi0, -i=mi1 and -i=mi.
Diffstat (limited to 'gdb')
-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 5872332..a0614d7 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 6824e38..be5450b 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 9f2daef..ba62333 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 6c1eb42..e9b6049 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 c7476cd..5f73ddf 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 0e0ac3f..034d3c1 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 37a643c..1ae693f 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 4349d09..0c1e353 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 41ce792..85d9924 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 8ac38ea..d2df948 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 04ee841..7b7a706 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 75f097d..a1325d6f 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 542d31d..780605b 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 44b7ff3..98ee504 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 871b129..a7b2a1a 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 089b767..808c087 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 57ea05e..81680a4 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 636f60d..d5b528d 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 045e981..1ec987a 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 a67d742..23387d4 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 cf3c21d..13c73e3 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 539a58d..0b9ebc3 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 6ac6e6b..1d77df5 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 f1fcedd..a9ae101 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 4f231d0..f57280b 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 5b8908a..04c2b9f 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 41ce792..a64fdf2 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 8ac38ea..fdad674 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 04ee841..3e03fcf 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 75f097d..deddf4b 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 542d31d..ff41510 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 44b7ff3..f8109bc 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 871b129..bf344fc 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 089b767..c918693 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 57ea05e..5f3b585 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 636f60d..55c699c 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 045e981..ebed25d 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 a67d742..def2134 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 cf3c21d..12c711e 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 539a58d..d0f69b8 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 6ac6e6b..e5c62c9 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 f1fcedd..ed48e5e 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 4f231d0..ee29d43 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 5b8908a..c66cbb5 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] {