From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5636 invoked by alias); 21 Oct 2002 22:28:34 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5628 invoked from network); 21 Oct 2002 22:28:32 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 21 Oct 2002 22:28:32 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g9LM7Hw18451 for ; Mon, 21 Oct 2002 18:07:17 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g9LMSVf21012; Mon, 21 Oct 2002 18:28:31 -0400 Received: from localhost.redhat.com (IDENT:E5n4KBFTppTTC3EmnmS2qzxqt0SlfHaA@tooth.toronto.redhat.com [172.16.14.29]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g9LMSUw18890; Mon, 21 Oct 2002 18:28:30 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id 5DA4CFF79; Mon, 21 Oct 2002 18:25:46 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15796.32490.200752.700605@localhost.redhat.com> Date: Mon, 21 Oct 2002 15:28:00 -0000 To: "J. Johnston" Cc: gdb-patches@sources.redhat.com Subject: Re: Patch for gdb/mi 604 In-Reply-To: <3D9B3D4D.C0B57920@redhat.com> References: <3D9B3D4D.C0B57920@redhat.com> X-SW-Source: 2002-10/txt/msg00358.txt.bz2 J. Johnston writes: > 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? > Wouldn't this affect the testsuite as well? Or is this behavior not tested? Elena > mi/ChangeLog: > > 2002-10-02 Jeff Johnston > > * 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.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