Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "J. Johnston" <jjohnstn@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: Patch for gdb/mi 604
Date: Wed, 02 Oct 2002 11:39:00 -0000	[thread overview]
Message-ID: <3D9B3D4D.C0B57920@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 473 bytes --]

The following patches mi-main.c to turn on the console output prefix prior
to outputting the gdb startup messages.  The code checks for mi level
and defers to old behavior for mi1.

Ok to commit?

mi/ChangeLog:

2002-10-02  Jeff Johnston  <jjohnstn@redhat.com>

	* mi-main.c: (mi_init_ui): If mi level > 1, set up gdb_stdout with
	console prefix.  Fix for PR gdb/604.
	(mi_command_loop): Add check for mi level.  If <= 1, set up gdb_stdout
	with console prefix.

-- Jeff J.

[-- Attachment #2: 604.patch --]
[-- Type: text/plain, Size: 1790 bytes --]

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

             reply	other threads:[~2002-10-02 18:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-02 11:39 J. Johnston [this message]
2002-10-21 15:28 ` Elena Zannoni
2002-10-21 16:03   ` J. Johnston
2002-10-22  7:28     ` Elena Zannoni
2002-10-22  8:19       ` Andrew Cagney
2002-11-06 17:22         ` J. Johnston
2002-11-07 15:30           ` Elena Zannoni
2002-11-07 15:43             ` J. Johnston
2002-11-08  6:03               ` Elena Zannoni
2002-11-08 12:39                 ` J. Johnston

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D9B3D4D.C0B57920@redhat.com \
    --to=jjohnstn@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox