diff options
author | Patrick Palka <patrick@parcs.ath.cx> | 2015-06-02 22:49:15 -0400 |
---|---|---|
committer | Patrick Palka <patrick@parcs.ath.cx> | 2015-06-26 11:05:56 -0400 |
commit | fc637f04c741b08726cc1631428bf094235ecb4e (patch) | |
tree | 1bb91721617e984a814138fd3fb0401af3541ba4 /gdb/NEWS | |
parent | 2e52ae68e7cedc3a1f9908c98ee60a8602705835 (diff) | |
download | gdb-fc637f04c741b08726cc1631428bf094235ecb4e.zip gdb-fc637f04c741b08726cc1631428bf094235ecb4e.tar.gz gdb-fc637f04c741b08726cc1631428bf094235ecb4e.tar.bz2 |
Add option to remove duplicate command history entries
This patch implements the new option "history remove-duplicates", which
controls the removal of duplicate history entries ("off" by default).
The motivation for this option is to be able to reduce the prevalence of
basic commands such as "up" and "down" in the history file. These
common commands crowd out more unique commands in the history file (when
the history file has a fixed size), and they make navigation of the
history file via ^P, ^N and ^R more inconvenient.
The option takes an integer denoting the number of history entries to
look back at for a history entry that is a duplicate of the latest one.
"history remove-duplicates 1" is equivalent to bash's ignoredups option,
and "history remove-duplicates unlimited" is equivalent to bash's
erasedups option.
[ I decided to go with this integer approach instead of a tri-state enum
because it's slightly more flexible and seemingly more intuitive than
leave/erase/ignore. ]
gdb/ChangeLog:
* NEWS: Mention the new option "history remove-duplicates".
* top.c (history_remove_duplicates): New static variable.
(show_history_remove_duplicates): New static function.
(gdb_add_history): Conditionally remove duplicate history
entries.
(init_main): Add "history remove-duplicates" option.
gdb/doc/ChangeLog:
* gdb.texinfo (Command History): Document the new option
"history remove-duplicates".
gdb/testsuite/ChangeLog:
* gdb.base/history-duplicates.exp: New test.
Diffstat (limited to 'gdb/NEWS')
-rw-r--r-- | gdb/NEWS | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -145,6 +145,10 @@ show max-completions to avoid generating large completion lists, the computation of which can cause the debugger to become temporarily unresponsive. +set history remove-duplicates +show history remove-duplicates + Control the removal of duplicate history entries. + maint set symbol-cache-size maint show symbol-cache-size Control the size of the symbol cache. |