From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Move "tee" building down to interpreter::set_logging_proc
Date: Thu, 02 Feb 2017 20:42:00 -0000 [thread overview]
Message-ID: <3047e09325f39e0acf745009c17d75d1@polymtl.ca> (raw)
In-Reply-To: <eea863e2-ee46-6497-ebd8-ae97a0a0abee@redhat.com>
On 2017-02-02 13:04, Pedro Alves wrote:
> 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);
LGTM!
next prev parent reply other threads:[~2017-02-02 20:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-02 14:28 Pedro Alves
2017-02-02 15:17 ` Simon Marchi
2017-02-02 17:39 ` Pedro Alves
2017-02-02 17:45 ` Simon Marchi
2017-02-02 18:04 ` Pedro Alves
2017-02-02 20:42 ` Simon Marchi [this message]
2017-02-02 22:12 ` Pedro Alves
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=3047e09325f39e0acf745009c17d75d1@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=palves@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