]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/testsuite/ChangeLog
Don't truncate the history file when history size is unlimited
authorPatrick Palka <patrick@parcs.ath.cx>
Thu, 4 Jun 2015 14:12:27 +0000 (10:12 -0400)
committerPatrick Palka <patrick@parcs.ath.cx>
Wed, 17 Jun 2015 13:41:58 +0000 (09:41 -0400)
commit2093d2d31460dc351145c4c295ea4a101e0c5aed
treeff662aecdbaeaec4f35f60a3805ab72a339ca912
parent1256987795a7f61826c0e5cc2ee023a579bb0a80
Don't truncate the history file when history size is unlimited

We still do not handle "set history size unlimited" correctly.  In
particular, after writing to the history file, we truncate the history
even if it is unlimited.

This patch makes sure that we do not call history_truncate_file() if the
history is not stifled (i.e. if it's unlimited).  This bug causes the
history file to be truncated to zero on exit when one has "set history
size unlimited" in their gdbinit file.  Although this code exists in GDB
7.8, the bug is masked by a pre-existing bug that's been only fixed in
GDB 7.9 (PR gdb/17820).

gdb/ChangeLog:

* top.c (gdb_safe_append_history): Do not call
history_truncate_file if the history is not stifled.

gdb/testsuite/ChangeLog:

* gdb.base/gdbinit-history.exp: Add test case to check that
an unlimited history file does not get truncated on exit.
gdb/ChangeLog
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/gdbinit-history.exp
gdb/top.c