From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21879 invoked by alias); 14 Sep 2011 17:48:31 -0000 Received: (qmail 21866 invoked by uid 22791); 14 Sep 2011 17:48:30 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 14 Sep 2011 17:48:08 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1R3tZ9-0000wG-FR from pedro_alves@mentor.com ; Wed, 14 Sep 2011 10:48:07 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 14 Sep 2011 18:48:05 +0100 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [PATCH] GDB session logging Date: Thu, 15 Sep 2011 06:30:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.0; x86_64; ; ) Cc: Abhijit Halder References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201109141848.03651.pedro@codesourcery.com> 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: 2011-09/txt/msg00261.txt.bz2 On Wednesday 14 September 2011 17:48:15, Abhijit Halder wrote: > +/* Unlike standerd GDB logger stream, dump data only to the log-file. */ > +extern struct ui_file *gdb_logfile; Typo standard. I don't understand the comment. > @@ -166,6 +166,7 @@ pop_output_files (void) > saved_output.log = NULL; > saved_output.targ = NULL; > saved_output.targerr = NULL; > + gdb_logfile = logging_no_redirect_file; This is always NULL here. Please make sure the output log makes sense with trace-commands enabled. I don't think printing the prompt and the command as you're doing works correctly. E.g., you'll print the prompt and the command even for commands in a breakpoint's command list. You want to print whatever the _user_ typed in, right? That is, from a level higher up, in event-top.c:command_handler, and event-top.c:display_gdb_prompt. But then that does leave out from the log commands that were run from "(gdb) define"d commands, and breakpoint command lists, etc. But that's what "set trace-commands" does. So, should we really change what we log backwards incompatibly? I'd say if you want the log of the whole complete session as you saw it the first time, you just do logging elsewhere, say, in your terminal, instead of within gdb. -- Pedro Alves