[1/2] cli/cli-logging.c: don't call ui_out_redirect for MI when disabling logging
Commit Message
When logging is set up, the code skips the call to ui_out_redirect if the
current interpreter is MI, but still calls it unconditionally when logging
is turned off. Since the number of "redirect"/"unredirect" calls must match,
this patch ensures that the ui_out_redirect call is also skipped when logging
is turned off.
gdb/
2014-07-23 Adrian Sendroiu <adrian.sendroiu@freescale.com>
* cli/cli-logging.c (pop_output_files): Don't call ui_out_redirect
if the current interpreter is MI.
---
gdb/cli/cli-logging.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
>>>>> "Adrian" == Adrian Sendroiu <adrian.sendroiu@freescale.com> writes:
Adrian> 2014-07-23 Adrian Sendroiu <adrian.sendroiu@freescale.com>
Adrian> * cli/cli-logging.c (pop_output_files): Don't call ui_out_redirect
Adrian> if the current interpreter is MI.
Thanks, this is ok.
Tom
@@ -180,7 +180,8 @@ pop_output_files (void)
saved_output.targ = NULL;
saved_output.targerr = NULL;
- ui_out_redirect (current_uiout, NULL);
+ if (!ui_out_is_mi_like_p (current_uiout))
+ ui_out_redirect (current_uiout, NULL);
}
/* This is a helper for the `set logging' command. */