Index: mi/mi-main.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-main.c,v retrieving revision 1.32 diff -u -r1.32 mi-main.c --- mi/mi-main.c 1 Oct 2002 21:15:43 -0000 1.32 +++ mi/mi-main.c 2 Oct 2002 18:34:12 -0000 @@ -1459,12 +1459,16 @@ 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, "~"); + if (mi_version <= 1) + { + /* 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; @@ -1536,8 +1540,16 @@ static void mi_init_ui (char *arg0) { - /* Eventually this will contain code that takes control of the - console. */ + if (strlen (interpreter_p) <= 2 || + interpreter_p[2] > '1') + { + /* 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, "~"); + } } void