This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 1/2] cli/cli-logging.c: don't call ui_out_redirect for MI when disabling logging
- From: Adrian Sendroiu <adrian dot sendroiu at freescale dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: Adrian Sendroiu <adrian dot sendroiu at freescale dot com>
- Date: Wed, 23 Jul 2014 17:26:14 +0300
- Subject: [PATCH 1/2] cli/cli-logging.c: don't call ui_out_redirect for MI when disabling logging
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=fail (sender IP is 192.88.168.50) smtp dot mailfrom=adrian dot sendroiu at freescale dot com;
- References: <1406125575-28311-1-git-send-email-adrian dot sendroiu at freescale dot com>
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(-)
diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c
index aae0039..e51bb95 100644
--- a/gdb/cli/cli-logging.c
+++ b/gdb/cli/cli-logging.c
@@ -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. */
--
1.7.9.5