From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17561 invoked by alias); 2 Oct 2002 18:39:13 -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 17543 invoked from network); 2 Oct 2002 18:39:10 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 2 Oct 2002 18:39:10 -0000 Received: from redhat.com (toocool.toronto.redhat.com [172.16.14.72]) by touchme.toronto.redhat.com (Postfix) with ESMTP id B36968000E1 for ; Wed, 2 Oct 2002 14:39:09 -0400 (EDT) Message-ID: <3D9B3D4D.C0B57920@redhat.com> Date: Wed, 02 Oct 2002 11:39:00 -0000 From: "J. Johnston" Organization: Red Hat Inc. X-Accept-Language: en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: Patch for gdb/mi 604 Content-Type: multipart/mixed; boundary="------------0E4C16DE90D2C98353E5B8E8" X-SW-Source: 2002-10/txt/msg00064.txt.bz2 This is a multi-part message in MIME format. --------------0E4C16DE90D2C98353E5B8E8 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-length: 473 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 * 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. --------------0E4C16DE90D2C98353E5B8E8 Content-Type: text/plain; charset=us-ascii; name="604.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="604.patch" Content-length: 1790 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 --------------0E4C16DE90D2C98353E5B8E8--