From patchwork Wed Jul 23 14:26:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Sendroiu X-Patchwork-Id: 2148 Received: (qmail 16151 invoked by alias); 23 Jul 2014 14:26:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 16089 invoked by uid 89); 23 Jul 2014 14:26:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: na01-bn1-obe.outbound.protection.outlook.com Received: from mail-bn1lp0142.outbound.protection.outlook.com (HELO na01-bn1-obe.outbound.protection.outlook.com) (207.46.163.142) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 23 Jul 2014 14:26:37 +0000 Received: from CH1PR03CA007.namprd03.prod.outlook.com (10.255.156.152) by BY2PR03MB143.namprd03.prod.outlook.com (10.242.35.149) with Microsoft SMTP Server (TLS) id 15.0.990.7; Wed, 23 Jul 2014 14:26:33 +0000 Received: from BN1BFFO11FD044.protection.gbl (10.255.156.132) by CH1PR03CA007.outlook.office365.com (10.255.156.152) with Microsoft SMTP Server (TLS) id 15.0.990.7 via Frontend Transport; Wed, 23 Jul 2014 14:26:32 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD044.mail.protection.outlook.com (10.58.144.107) with Microsoft SMTP Server (TLS) id 15.0.980.11 via Frontend Transport; Wed, 23 Jul 2014 14:26:32 +0000 Received: from fsr-ub1264-100.ea.freescale.net (fsr-ub1264-100.ea.freescale.net [10.171.74.130]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s6NEQPga023333; Wed, 23 Jul 2014 07:26:30 -0700 From: Adrian Sendroiu To: CC: Adrian Sendroiu Subject: [PATCH 1/2] cli/cli-logging.c: don't call ui_out_redirect for MI when disabling logging Date: Wed, 23 Jul 2014 17:26:14 +0300 Message-ID: <1406125575-28311-2-git-send-email-adrian.sendroiu@freescale.com> In-Reply-To: <1406125575-28311-1-git-send-email-adrian.sendroiu@freescale.com> References: <1406125575-28311-1-git-send-email-adrian.sendroiu@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(189002)(199002)(377424004)(50986999)(229853001)(102836001)(83072002)(107046002)(81342001)(64706001)(33646002)(95666004)(85852003)(74502001)(74662001)(77156001)(50226001)(99396002)(86362001)(104016003)(79102001)(47776003)(44976005)(76176999)(92726001)(20776003)(80022001)(81542001)(110136001)(93916002)(92566001)(2351001)(19580405001)(26826002)(85306003)(97736001)(89996001)(46102001)(62966002)(68736004)(87286001)(83322001)(104166001)(88136002)(84676001)(50466002)(21056001)(19580395003)(76482001)(6806004)(105606002)(4396001)(36756003)(87936001)(48376002)(77982001)(106466001)(31966008); DIR:OUT; SFP:; SCL:1; SRVR:BY2PR03MB143; H:tx30smr01.am.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 028166BF91 Received-SPF: Fail (: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=adrian.sendroiu@freescale.com; X-OriginatorOrg: freescale.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 * 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. */