From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9262 invoked by alias); 27 Jun 2012 22:24:19 -0000 Received: (qmail 9252 invoked by uid 22791); 27 Jun 2012 22:24:19 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from elasmtp-mealy.atl.sa.earthlink.net (HELO elasmtp-mealy.atl.sa.earthlink.net) (209.86.89.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 27 Jun 2012 22:24:06 +0000 Received: from [68.96.200.16] (helo=macbook2.local) by elasmtp-mealy.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1Sk0eb-0002Bo-Ki; Wed, 27 Jun 2012 18:24:05 -0400 Message-ID: <4FEB8801.6080502@earthlink.net> Date: Wed, 27 Jun 2012 22:24:00 -0000 From: Stan Shebs User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: [PATCH] Logging for MI References: <4FE80E5E.903@earthlink.net> <87sjdg5ysf.fsf@fleche.redhat.com> In-Reply-To: <87sjdg5ysf.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ELNK-Trace: ae6f8838ff913eba0cc1426638a40ef67e972de0d01da940e9f89617fe850351a57335ecfb82b527350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00843.txt.bz2 On 6/27/12 12:40 PM, Tom Tromey wrote: >>>>>> "Stan" == Stan Shebs writes: > Stan> Although the patch seems straightforward, it entailed quite a bit of > Stan> trial-and-error, and I've probably missed a few cases in the tangled > Stan> tubing that is GDB's ui-file system; comments welcome. > > I don't really understand all that code either. > It is pretty light on docs; but also just convoluted. > > Stan> I plan to commit this in a few days if no flaws come to light. > > I was curious whether it did the right thing if logging is enabled and > then the user sends a CLI command to the MI interpreter. > I dug through the code a little but couldn't convince myself either way. > > Tom > It does in fact do the right thing, and I checked just now to be sure. :-) The theory of CLI output is that gdb_stdout is set to the mi->out console, which prefixes random CLI text with a tilde and encloses it in quotes. So changing gdb_stdout isn't sufficient, one has to reach in under the consoles and replace their streams with the open file or tee. Stan