Re: [PATCH] Move "tee" building down to interpreter::set_logging_proc

Pedro Alves
2017-02-02T17:39:19Z

On 02/02/2017 03:17 PM, Simon Marchi wrote:
> On 2017-02-02 09:28, Pedro Alves wrote:
>> @@ -109,13 +109,13 @@ extern int current_interp_named_p (const char
>> *name);
>>
>> /* Call this function to give the current interpreter an opportunity
>> to do any special handling of streams when logging is enabled or
>> - disabled. START_LOG is 1 when logging is starting, 0 when it ends,
>> - and OUT is the stream for the log file; it will be NULL when
>> - logging is ending. LOGFILE is non-NULL if the output streams
>> + disabled. START_LOG is true when logging is starting, false when
>
> START_LOG is not there anymore. From what I understand, it's replaced
> with LOGFILE being null or not?

You're right. How about this:

-- i/gdb/interps.h
+++ w/gdb/interps.h
@@ -109,10 +109,10 @@ extern int current_interp_named_p (const char *name);

/* Call this function to give the current interpreter an opportunity
to do any special handling of streams when logging is enabled or
- disabled. START_LOG is true when logging is starting, false when
- it ends. LOGFILE is the stream for the log file; it's 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. */
+ 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. */

extern void current_interp_set_logging (ui_file_up logfile,
bool logging_redirect);

OK?

> Otherwise, LGTM.

Thanks!

--
Pedro Alves