From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32502 invoked by alias); 6 May 2013 09:43:37 -0000 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 Received: (qmail 32492 invoked by uid 89); 6 May 2013 09:43:36 -0000 X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 06 May 2013 09:43:36 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UZHxG-0000Ff-MQ from Muhammad_Bilal@mentor.com ; Mon, 06 May 2013 02:43:34 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 6 May 2013 02:43:34 -0700 Received: from [137.202.157.37] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.2.247.3; Mon, 6 May 2013 10:43:32 +0100 Message-ID: <51877B42.7@codesourcery.com> Date: Mon, 06 May 2013 09:43:00 -0000 From: mbilal User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: , , Subject: [PATCH 3/7] PR gdb/15224 should "set history save on" by default References: <51877A32.1030503@codesourcery.com> <51877A99.4060503@codesourcery.com> In-Reply-To: <51877A99.4060503@codesourcery.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg00100.txt.bz2 On Wednesday, April 03, 2013 7:30 PM Jan Kratochvil wrote: > (3) Fix currently incorrectly touched history file even if no commands get here is patch Index: top.c =================================================================== RCS file: /cvs/src/src/gdb/top.c,v retrieving revision 1.235 diff -u -p -r1.235 top.c --- top.c 17 Apr 2013 01:02:02 -0000 1.235 +++ top.c 6 May 2013 06:16:04 -0000 @@ -1430,7 +1430,8 @@ quit_force (char *args, int from_tty) /* Save the history information if it is appropriate to do so. */ DO_TRY { - if (write_history_p && history_filename) + if (write_history_p && history_filename + && input_from_terminal_p()) write_history (history_filename); } DO_PRINT_EX; I have tested $ ls -als ~/gdb_history 0 -rw-rw-r-- 1 mbilal mbilal 0 May 6 13:12 /home/mbilal/gdb_history $ date Mon May 6 13:16:09 PKT 2013 $ ./gdb-cvs/src/gdb/gdb gdb -ex "set history filename ~/gdb_history" < /dev/null GNU gdb (GDB) 7.6.50.20130503-cvs Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: ... Reading symbols from /usr/local/bin/gdb...done. (gdb) quit $ ls -als ~/gdb_history 0 -rw-rw-r-- 1 mbilal mbilal 0 May 6 13:12 /home/mbilal/gdb_history Thanks, -Bilal