aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2002-11-08 20:39:06 +0000
committerJeff Johnston <jjohnstn@redhat.com>2002-11-08 20:39:06 +0000
commite78c0063c1d58fe319da742239347de50512b087 (patch)
tree67bea964d7b6b8b928273620b5aaddda2e2ba679 /gdb
parent1f312e798bdf71aa0c9295e2f14a338b2b975d18 (diff)
downloadgdb-e78c0063c1d58fe319da742239347de50512b087.zip
gdb-e78c0063c1d58fe319da742239347de50512b087.tar.gz
gdb-e78c0063c1d58fe319da742239347de50512b087.tar.bz2
2002-11-08 Jeff Johnston <jjohnstn@redhat.com>
* mi-main.c (mi_command_loop): Initialize raw_stdout and gdb_stdout only if mi version is <= 1. (mi_init_ui): Initialize raw_stdout and gdb_stdout if mi version is > 1 so startup message is treated as console output. This is part of fix for PR gdb/604.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/mi/ChangeLog8
-rw-r--r--gdb/mi/mi-main.c28
2 files changed, 28 insertions, 8 deletions
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index c59019f..d84c87b 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,3 +1,11 @@
+2002-11-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * mi-main.c (mi_command_loop): Initialize raw_stdout and gdb_stdout
+ only if mi version is <= 1.
+ (mi_init_ui): Initialize raw_stdout and gdb_stdout if mi version
+ is > 1 so startup message is treated as console output. This is
+ part of fix for PR gdb/604.
+
2002-11-06 Jeff Johnston <jjohnstn@redhat.com>
* mi-cmd-var.c (mi_cmd_var_create): Change the function used to
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 5e8b13b..57ca218 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -1464,12 +1464,16 @@ mi_load_progress (const char *section_name,
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;
@@ -1541,8 +1545,16 @@ setup_architecture_data (void)
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