Currently incorrectly history file is touched even if no commands get, added to it. below is use case for it (enabled history save on). $ ls -als ~/gdb_history 0 -rw-rw-r-- 1 mbilal mbilal 0 Aug 8 07:14 /home/mbilal/gdb_history $ date Thu Aug 8 07:15:53 PKT 2013 $ ./gdb -ex "set history filename ~/gdb_history" < /dev/null GNU gdb (GDB) 7.6.50.20130807-cvs Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> 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: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word". (gdb) quit $ ls -als ~/gdb_history 0 -rw-rw-r-- 1 mbilal mbilal 0 Aug 8 07:15 /home/mbilal/gdb_history
CVSROOT: /cvs/src Module name: src Changes by: mbilal@sourceware.org 2013-08-15 08:18:32 Modified files: gdb : top.c ChangeLog Log message: 2013-08-15 Muhammad Bilal <mbilal@codesourcery.com> PR cli/15841 * top.c (quit_force): Skip writing history file if input is not from terminal. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/top.c.diff?cvsroot=src&r1=1.240&r2=1.241 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15906&r2=1.15907
fixed