From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81718 invoked by alias); 2 Feb 2017 18:04:28 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 81702 invoked by uid 89); 2 Feb 2017 18:04:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Ownership, tense, H*f:sk:e08d9eb, teeed X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 02 Feb 2017 18:04:26 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 28E3E7EBA4; Thu, 2 Feb 2017 18:04:26 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v12I4OW2013165; Thu, 2 Feb 2017 13:04:25 -0500 Subject: Re: [PATCH] Move "tee" building down to interpreter::set_logging_proc To: Simon Marchi References: <1486045694-22866-1-git-send-email-palves@redhat.com> <1fc904d1eef0f26d27539a2b2b4da5ab@polymtl.ca> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Thu, 02 Feb 2017 18:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1fc904d1eef0f26d27539a2b2b4da5ab@polymtl.ca> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-02/txt/msg00074.txt.bz2 On 02/02/2017 05:44 PM, Simon Marchi wrote: > Yeah sounds good. > > Though the pre-existing sentence "...if the output streams are to be > tees" is not that clear to me, I'm not sure I would understand if I > didn't already know what the function does. Why does it talk about > multiple output streams that have to be tees, isn't there only one tee? > Or is it meant to be a past tense verb, in which case it should be > something like "...are to be tee-ed"? I just find the formulation awkward. I think it's saying that all of "gdb_stdout, gdb_stderr, gdb_stdlog", etc. should all end up as tees. They happens to end up as the same tee object, but it's true that they're all tees. How about this? diff --git i/gdb/cli/cli-interp.h w/gdb/cli/cli-interp.h index abae3d6..accecfa 100644 --- i/gdb/cli/cli-interp.h +++ w/gdb/cli/cli-interp.h @@ -21,12 +21,14 @@ struct interp; /* Make the output ui_file to use when logging is enabled. - CURR_OUTPUT is the current stream where output is currently being - sent to. LOGFILE is the already-open log file. LOGGING_REDIRECT - is true if the output is to be the logfile, and false if the output - stream is to be a tee, with the log file as one of the outputs. - Ownership of the log file is transferred to the returned output - file. The returned output file is an owning pointer. */ + CURR_OUTPUT is the stream where output is currently being sent to + (e.g., gdb_stdout for the CLI, raw output stream for the MI). + LOGFILE is log file already opened by the caller. LOGGING_REDIRECT + is the value of the "set logging redirect" setting. If true, the + resulting output is the logfile. If false, the output stream is a + tee, with the log file as one of the outputs. Ownership of LOGFILE + is transferred to the returned output file, which is an owning + pointer. */ extern ui_file *make_logging_output (ui_file *curr_output, ui_file_up logfile, bool logging_redirect); diff --git i/gdb/interps.h w/gdb/interps.h index 7672393..ef2ceeb 100644 --- i/gdb/interps.h +++ w/gdb/interps.h @@ -111,9 +111,11 @@ extern int current_interp_named_p (const char *name); to do any special handling of streams when logging is enabled or disabled. LOGFILE is the stream for the log file when logging is starting and is NULL when logging is ending. LOGGING_REDIRECT is - false if the output streams are to be tees, with the log file as - one of the outputs. */ - + the value of the "set logging redirect" setting. If true, the + interpreter should configure the output streams to send output only + to the logfile. If false, the interpreter should configure the + output streams to send output to both the current output stream + (i.e., the terminal) and the log file. */ extern void current_interp_set_logging (ui_file_up logfile, bool logging_redirect);