binutils-gdb/gdb/testsuite/gdb.base
Patrick Palka fc637f04c7 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.
2015-06-26 11:05:56 -04:00
..
comp-dir/subdir
gdbinit-history Fix PR gdb/17820 2015-05-13 09:26:54 -04:00
a2-run.exp
advance.c
advance.exp
alias.exp
all-bin.exp
all-types.c
annota-input-while-running.c
annota-input-while-running.exp
annota1.c
annota1.exp
annota3.c
annota3.exp
anon.c
anon.exp
args.c
args.exp
argv0-symlink.c
argv0-symlink.exp
arithmet.exp
arrayidx.c
arrayidx.exp
assign.exp
async-shell.c
async-shell.exp
async.c
async.exp
attach-pie-misread.c
attach-pie-misread.exp
attach-pie-noexec.c
attach-pie-noexec.exp Skip two more attach tests when testing against stub-like targets 2015-01-15 10:59:57 -08:00
attach-twice.c
attach-twice.exp Skip two more attach tests when testing against stub-like targets 2015-01-15 10:59:57 -08:00
attach-wait-input.c
attach-wait-input.exp
attach.c
attach.exp Fix three test failures with extended remote targets 2015-04-20 11:36:02 +01:00
attach2.c
auto-connect-native-target.c
auto-connect-native-target.exp
auto-load-script
auto-load.c
auto-load.exp
auxv.c
auxv.exp
average.c
bang.exp
bar.c
batch-preserve-term-settings.c PR cli/17828: -batch -ex r breaks terminal 2015-01-14 11:51:06 +00:00
batch-preserve-term-settings.exp PR cli/17828: -batch -ex r breaks terminal 2015-01-14 11:51:06 +00:00
baz.c
bfp-test.c
bfp-test.exp
bg-execution-repeat.c
bg-execution-repeat.exp
bigcore.c
bigcore.exp
bitfields.c
bitfields.exp
bitfields2.c
bitfields2.exp
bitops.exp
bp-cmds-execution-x-script.c PR17525 - breakpoint commands not executed when program run from -x script 2015-01-14 12:34:12 +00:00
bp-cmds-execution-x-script.exp PR17525 - breakpoint commands not executed when program run from -x script 2015-01-14 12:34:12 +00:00
bp-cmds-execution-x-script.gdb PR17525 - breakpoint commands not executed when program run from -x script 2015-01-14 12:34:12 +00:00
bp-permanent.c
bp-permanent.exp Harden gdb.base/bp-permanent.exp 2015-04-14 09:25:27 -03:00
branches.c
break-always.c
break-always.exp Handle memory write errors on gdb.base/break-always.exp 2015-04-29 12:09:40 -03:00
break-caller-line.c
break-caller-line.exp
break-entry.exp
break-idempotent.c
break-idempotent.exp Skip setting HW watchpoint if skip_hw_watchpoint_multi_tests in gdb.base/break-idempotent.exp 2015-04-30 10:08:10 +01:00
break-inline.c
break-inline.exp
break-interp-lib.c
break-interp-main.c
break-interp.exp
break-main-file-remove-fail.c
break-main-file-remove-fail.exp
break-on-linker-gcd-function.cc
break-on-linker-gcd-function.exp
break-probes-solib.c
break-probes.c
break-probes.exp Make the default sysroot be "target:" 2015-04-02 13:38:29 +01:00
break-unload-file.c
break-unload-file.exp
break.c
break.exp
break1.c
breakpoint-in-ro-region.c
breakpoint-in-ro-region.exp breakpoint-in-ro-region.exp: Support targets stopping in mid-line after "si" 2015-03-04 10:40:40 +01:00
breakpoint-shadow.c
breakpoint-shadow.exp
call-ar-st.c
call-ar-st.exp
call-rt-st.c
call-rt-st.exp
call-sc.c
call-sc.exp
call-signal-resume.exp
call-signals.c
call-strs.c
call-strs.exp
callexit.c
callexit.exp
callfuncs.c
callfuncs.exp
catch-gdb-caused-signals.c Fix non executable stack handling when calling functions in the inferior. 2015-02-19 11:04:21 -05:00
catch-gdb-caused-signals.exp Fix non executable stack handling when calling functions in the inferior. 2015-02-19 11:04:21 -05:00
catch-load-so.c
catch-load.c
catch-load.exp
catch-signal-fork.c
catch-signal-fork.exp
catch-signal.c
catch-signal.exp
catch-syscall.c Support catch syscall on aarch64 linux 2015-03-18 10:47:45 +00:00
catch-syscall.exp Support catch syscall on aarch64 linux 2015-03-18 10:47:45 +00:00
charset-malloc.c
charset.c
charset.exp
checkpoint.c
checkpoint.exp
chng-syms.c
chng-syms.exp
code-expr.exp
code_elim.exp
code_elim1.c
code_elim2.c
commands.exp
compare-sections.c
compare-sections.exp
completion.exp Add tab completion for TUI's "focus" command 2015-06-26 10:11:28 -04:00
complex.c
complex.exp
comprdebug.exp
cond-eval-mode.c
cond-eval-mode.exp
cond-expr.exp
condbreak-call-false.c
condbreak-call-false.exp
condbreak.exp
consecutive-step-over.c
consecutive-step-over.exp
consecutive.c
consecutive.exp
constvars.c
constvars.exp
continue-all-already-running.c
continue-all-already-running.exp
coredump-filter.c Fix PR 18208: update /proc/pid/coredump_filter by c code 2015-05-08 12:37:48 +01:00
coredump-filter.exp Fix coredump-filter.exp by correctly unsetting array 2015-05-08 13:19:19 -04:00
corefile.exp
coremaker.c
coremaker2.c
ctxobj-f.c
ctxobj-m.c
ctxobj-v.c
ctxobj.exp
cursal.c
cursal.exp
cvexpr.c
cvexpr.exp
d10v.ld
d10vovly.c
dbx.exp
dcache-line-read-error.c
dcache-line-read-error.exp
debug-expr.c
debug-expr.exp
default.exp
define.exp
del.c
del.exp
detach.exp
dfp-exprs.exp
dfp-test.c
dfp-test.exp
disabled-location.c
disabled-location.exp
disasm-end-cu-1.c
disasm-end-cu-2.c
disasm-end-cu.exp
disp-step-fork.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
disp-step-syscall.exp Tighten gdb.base/disp-step-syscall.exp 2015-03-18 19:28:08 +00:00
disp-step-vfork.c
display.c
display.exp
dmsym.c
dmsym.exp
dmsym_main.c
double-prompt-target-event-error.c
double-prompt-target-event-error.exp
dprintf-bp-same-addr.c
dprintf-bp-same-addr.exp
dprintf-detach.c
dprintf-detach.exp
dprintf-next.c
dprintf-next.exp
dprintf-non-stop.c
dprintf-non-stop.exp
dprintf-pending.c
dprintf-pending.exp
dprintf-pendshr.c
dprintf.c
dprintf.exp
dtrace-probe.c Simple testsuite for DTrace USDT probes. 2015-02-17 16:41:16 +01:00
dtrace-probe.d Simple testsuite for DTrace USDT probes. 2015-02-17 16:41:16 +01:00
dtrace-probe.exp Simple testsuite for DTrace USDT probes. 2015-02-17 16:41:16 +01:00
dump.c
dump.exp gdb: Add support for dumping to verilog hex format. 2015-04-24 22:49:59 +01:00
dup-sect.exp
dup-sect.S
duplicate-bp.c
duplicate-bp.exp
echo.exp
empty_exe.exp
ena-dis-br.exp "enable count" user input error handling (PR gdb/15678) 2015-02-06 10:27:01 -05:00
ending-run.c
ending-run.exp
enum_cond.c
enum_cond.exp
enumval.c
enumval.exp
environ.exp
eu-strip-infcall.c
eu-strip-infcall.exp
eval-avoid-side-effects.exp
eval-skip.exp
eval.exp
exe-lock.exp
execd-prog.c
execl-update-breakpoints.c
execl-update-breakpoints.exp
execution-termios.c
execution-termios.exp
exitsignal.exp
expand-psymtabs.c
expand-psymtabs.exp
exprs.c
exprs.exp
fileio.c
fileio.exp
filesym.c
filesym.exp
find-unmapped.c
find-unmapped.exp
find.c
find.exp
finish.exp
fixsection.c
fixsection.exp
fixsectshr.c
float.c
float.exp
foll-exec.c
foll-exec.exp
foll-fork.c
foll-fork.exp Enable gdb.base/foll-fork.exp on OpenBSD 2015-03-04 14:53:14 +01:00
foll-vfork-exit.c
foll-vfork.c
foll-vfork.exp Disable exec-dependent follow vfork tests for remote 2015-05-28 14:40:30 -07:00
foo.c
fortran-sym-case.c
fortran-sym-case.exp
frame-args.c
frame-args.exp
freebpcmd.c
freebpcmd.exp
fullname.c
fullname.exp
fullpath-expand-func.c
fullpath-expand.c
fullpath-expand.exp
func-ptr.c
func-ptr.exp
func-ptrs.c
func-ptrs.exp
funcargs.c
funcargs.exp
gcore-buffer-overflow.c
gcore-buffer-overflow.exp
gcore-relro-lib.c
gcore-relro-main.c
gcore-relro-pie.c
gcore-relro-pie.exp
gcore-relro.exp
gcore.c
gcore.exp
gdb-sigterm.c gdb.base/gdb-sigterm.exp: Fix spurious FAILs 2015-02-06 11:09:42 +01:00
gdb-sigterm.exp gdb.base/gdb-sigterm.exp: Fix spurious FAILs 2015-02-06 11:09:42 +01:00
gdb1056.exp
gdb1090.c
gdb1090.exp
gdb1250.c
gdb1250.exp
gdb1555-main.c
gdb1555.c
gdb1555.exp
gdb1821.c
gdb1821.exp
gdb11530.c
gdb11530.exp
gdb11531.c
gdb11531.exp
gdb_history
gdbhistsize-history.exp Tweak the handling of $GDBHISTSIZE edge cases [PR gdb/16999] 2015-06-17 14:12:19 -04:00
gdbindex-stabs-dwarf.c
gdbindex-stabs.c
gdbindex-stabs.exp
gdbinit-history.exp Test the interaction between GDBHISTSIZE and .gdbinit 2015-06-18 11:51:19 -04:00
gdbvars.c
gdbvars.exp
global-var-nested-by-dso-solib1.c
global-var-nested-by-dso-solib2.c
global-var-nested-by-dso.c
global-var-nested-by-dso.exp
gnu-debugdata.c
gnu-debugdata.exp
gnu-ifunc-lib.c
gnu-ifunc.c
gnu-ifunc.exp
gnu_vector.c Add vector ABI tests to gnu_vector.exp 2015-06-17 11:17:07 +02:00
gnu_vector.exp Add vector ABI tests to gnu_vector.exp 2015-06-17 11:17:07 +02:00
grbx.c
hashline1.exp
hashline2.exp
hashline3.exp
hbreak-in-shr-unsupported-shr.c
hbreak-in-shr-unsupported.c
hbreak-in-shr-unsupported.exp
hbreak-unmapped.c
hbreak-unmapped.exp
hbreak.c
hbreak.exp
hbreak2.exp
help.exp
history-duplicates.exp Add option to remove duplicate command history entries 2015-06-26 11:05:56 -04:00
hook-stop-continue.c
hook-stop-continue.exp
hook-stop-frame.c
hook-stop-frame.exp
huge.c
huge.exp
ifelse.exp
included.c
included.exp
included.h
inferior-died.c
inferior-died.exp
infnan.c
infnan.exp
info-fun-solib.c
info-fun.c
info-fun.exp
info-macros.c
info-macros.exp
info-os.c gdb.base/info-os.c: Include stdlib.h 2015-02-23 14:03:48 +00:00
info-os.exp
info-proc.exp
info-shared-solib1.c
info-shared-solib2.c
info-shared.c
info-shared.exp
info-target.exp
infoline.c
infoline.exp
int-type.c
interact.exp
interp.c
interp.exp
interrupt-noterm.c
interrupt-noterm.exp
interrupt.c Add "../lib/unbuffer_output.c" and use it in gdb.base/interrupt.c 2015-02-27 13:54:22 +00:00
interrupt.exp Fix gdb.base/interrupt.exp racy fail against gdbserver 2015-04-23 15:48:27 +01:00
jit-dlmain.c
jit-main.c
jit-simple.c
jit-simple.exp
jit-so.exp
jit-solib.c
jit.exp
jump.c
jump.exp
kill-after-signal.c
kill-after-signal.exp
label.c
label.exp
langs.exp
langs0.c
langs1.c
langs1.f
langs2.c
langs2.cxx
ldbl_e308.c
ldbl_e308.exp
line-symtabs.c
line-symtabs.exp
line-symtabs.h
lineinc.c
lineinc.exp
lineinc1.h
lineinc2.h
lineinc3.h
linespecs.exp
list.exp
list0.c
list0.h
list1.c
logical.exp
long_long.c
long_long.exp
longest-types.c
longest-types.exp
longjmp.c
longjmp.exp
m32r.ld
m32rovly.c
macscp.exp
macscp1.c
macscp2.h
macscp3.h
macscp4.h
maint.exp Move vptr_{fieldno,basetype} out of main_type, and update everything accordingly. 2015-01-31 21:40:57 -08:00
Makefile.in
memattr.c
memattr.exp
mips_pro.c
mips_pro.exp
miscexprs.c
miscexprs.exp
morestack.c
morestack.exp
moribund-step.exp
multi-forks.c
multi-forks.exp
multi-line-starts-subshell.exp
nextoverexit.c
nextoverexit.exp
nodebug.c
nodebug.exp
nofield.c
nofield.exp
noreturn-finish.c Use GCC5/DWARF5 DW_AT_noreturn to mark functions that don't return normally. 2015-01-23 17:29:19 +01:00
noreturn-finish.exp Use GCC5/DWARF5 DW_AT_noreturn to mark functions that don't return normally. 2015-01-23 17:29:19 +01:00
noreturn-return.c Use GCC5/DWARF5 DW_AT_noreturn to mark functions that don't return normally. 2015-01-23 17:29:19 +01:00
noreturn-return.exp Use GCC5/DWARF5 DW_AT_noreturn to mark functions that don't return normally. 2015-01-23 17:29:19 +01:00
normal.c
nostdlib.c
nostdlib.exp
opaque.exp
opaque0.c
opaque1.c
overlays.c
overlays.exp
ovlymgr.c
ovlymgr.h
page.exp
paginate-after-ctrl-c-running.c
paginate-after-ctrl-c-running.exp
paginate-bg-execution.c
paginate-bg-execution.exp
paginate-execution-startup.c
paginate-execution-startup.exp
paginate-inferior-exit.c
paginate-inferior-exit.exp
pc-fp.c
pc-fp.exp
pending.c
pending.exp
pendshr.c
permissions.exp
pi.txt
pie-execl.c
pie-execl.exp
pointers.c
pointers.exp
pr10179-a.c
pr10179-b.c
pr10179.exp
pr11022.c
pr11022.exp
prelink-lib.c
prelink.c
prelink.exp
print-file-var-lib1.c
print-file-var-lib2.c
print-file-var-main.c
print-file-var.exp
print-symbol-loading-lib.c
print-symbol-loading-main.c
print-symbol-loading.exp
printcmds.c
printcmds.exp
prologue-include.c
prologue-include.exp
prologue-include.h
prologue.c
prologue.exp
psymtab.exp
psymtab1.c
psymtab2.c
ptr-typedef.c
ptr-typedef.exp
ptype.c
ptype.exp
ptype1.c
radix.exp
random-signal.c
random-signal.exp
randomize.c
randomize.exp
range-stepping.c
range-stepping.exp
readline-ask.c
readline-ask.exp
readline-ask.inputrc
readline.exp Read $GDBHISTSIZE instead of $HISTSIZE 2015-06-17 14:03:50 -04:00
realname-expand-real.c
realname-expand.c
realname-expand.exp
recpar.c
recpar.exp
recurse.c
recurse.exp
relational.exp
relativedebug.c
relativedebug.exp Skip gdb.base/relativedebug.exp if libc doesn't have debug info 2015-04-30 09:55:06 +01:00
relocate.c
relocate.exp
remote.c
remote.exp
remotetimeout.exp
reread.exp
reread1.c
reread2.c
restore.c
restore.exp
return-nodebug.c
return-nodebug.exp
return-nodebug1.c
return.c
return.exp
return2.c
return2.exp
run.c
save-bp.c
save-bp.exp
savedregs.c
savedregs.exp Relax pattern to match the output of "info frame" in gdb.base/savedregs.exp 2015-03-26 08:16:20 +00:00
scope.exp
scope0.c
scope1.c
sect-cmd.exp
segv.c
sep-proc.c
sep.c
sep.exp
sepdebug.c
sepdebug.exp Allow gdb to find debug symbols file by build-id for PE file format also 2015-06-15 12:10:55 +01:00
sepdebug2.c
sepsymtab.c
sepsymtab.exp
set-lang-auto.exp
set-noassign.exp
setshow.c
setshow.exp
setvar.c
setvar.exp
shell.exp
shlib-call.exp
shmain.c
shr1.c
shr2.c
shreloc.c
shreloc.exp
shreloc1.c
shreloc2.c
sigall.c
sigall.exp
sigaltstack.c
sigaltstack.exp
sigbpt.c
sigbpt.exp
sigchld.c
sigchld.exp
siginfo-addr.c
siginfo-addr.exp
siginfo-infcall.c
siginfo-infcall.exp
siginfo-obj.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
siginfo-obj.exp New proc supports_get_siginfo_type 2015-06-24 14:53:03 +01:00
siginfo-thread.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
siginfo-thread.exp New proc supports_get_siginfo_type 2015-06-24 14:53:03 +01:00
siginfo.c
siginfo.exp
signals.c
signals.exp
signest.c
signest.exp
signull.c
signull.exp
sigrepeat.c
sigrepeat.exp
sigstep.c
sigstep.exp Fix gdb.base/sigstep.exp with displaced stepping on software single-step targets 2015-04-10 10:55:09 +01:00
sizeof.c
sizeof.exp
skip-solib-lib.c
skip-solib-main.c
skip-solib.exp
skip.c
skip.exp
skip1.c
so-disc-shr.c
so-impl-ld.c
so-impl-ld.exp
so-indr-cl.c
so-indr-cl.exp
solib-corrupted.exp Fix gdb.base/solib-corrupted.exp after dtrace probes changes 2015-02-20 23:10:53 +00:00
solib-disc.c
solib-disc.exp
solib-display-lib.c
solib-display-main.c
solib-display.exp
solib-nodir.exp
solib-overlap-lib.c
solib-overlap-main.c
solib-overlap.exp
solib-search-lib1.c
solib-search-lib2.c
solib-search.c
solib-search.exp
solib-search.h
solib-symbol-lib.c
solib-symbol-main.c
solib-symbol.exp
solib-weak.c
solib-weak.exp
solib.c
solib.exp
solib1.c
solib2.c
source-dir.exp
source-error.gdb
source-execution.c
source-execution.exp
source-execution.gdb
source-nofile.gdb
source-test.gdb
source.exp
spu.ld
ss.h
sss-bp-on-user-bp-2.c
sss-bp-on-user-bp-2.exp
sss-bp-on-user-bp.c
sss-bp-on-user-bp.exp
stack-checking.c
stack-checking.exp
stale-infcall.c
stale-infcall.exp
stap-probe.c
stap-probe.exp Move compute_probe_arg' and compile_probe_arg' to probe.c 2015-02-17 15:50:19 +01:00
start.c
start.exp
statistics.exp Introduce gdb_interact in testsuite 2015-01-22 15:49:08 -05:00
step-break.c
step-break.exp
step-bt.c
step-bt.exp
step-line.c
step-line.exp
step-line.inp
step-over-no-symbols.exp PR13858 - Can't do displaced stepping with no symbols 2015-04-10 10:07:02 +01:00
step-resume-infcall.c
step-resume-infcall.exp
step-sw-breakpoint-adjust-pc.c
step-sw-breakpoint-adjust-pc.exp
step-symless.c
step-symless.exp
step-test.c
step-test.exp
store.c
store.exp
structs.c
structs.exp Fix print of value type in a corner case of finish 2015-02-26 10:58:00 -05:00
structs2.c
structs2.exp
structs3.c
structs3.exp
subst.exp
sum.c
sym-file-lib.c
sym-file-loader.c
sym-file-loader.h
sym-file-main.c
sym-file.exp
symbol-without-target_section.c
symbol-without-target_section.exp
symtab-search-order-1.c
symtab-search-order-shlib-1.c
symtab-search-order.c
symtab-search-order.exp
term.c
term.exp
testenv.c
testenv.exp
trace-commands.exp
tui-layout.exp gdb/testsuite: New skip_tui_tests predicate. 2015-05-20 21:57:20 +02:00
twice.c
twice.exp
type-opaque-lib.c
type-opaque-main.c
type-opaque.exp
ui-redirect.exp
unload.c
unload.exp
unloadshr.c
unloadshr2.c
until-nodebug.exp
until.exp
unwindonsignal.c
unwindonsignal.exp
valgrind-db-attach.c
valgrind-db-attach.exp Introduce gdb_interact in testsuite 2015-01-22 15:49:08 -05:00
valgrind-infcall.c
valgrind-infcall.exp Introduce gdb_interact in testsuite 2015-01-22 15:49:08 -05:00
value-double-free.c
value-double-free.exp
varargs.c
varargs.exp
vdso-warning.c
vdso-warning.exp
vforked-prog.c
vla-datatypes.c
vla-datatypes.exp
vla-ptr.c
vla-ptr.exp
vla-sideeffect.c
vla-sideeffect.exp
vla-stub-define.c
vla-stub.c
vla-stub.exp
volatile.exp
watch-bitfields.c
watch-bitfields.exp Use software watchpoints if hardware watchpoints are not available when testing gdb.base/watch-bitfields.exp 2015-04-29 12:22:24 -03:00
watch-cond-infcall.c
watch-cond-infcall.exp
watch-cond.c
watch-cond.exp
watch-non-mem.c
watch-non-mem.exp
watch-read.c
watch-read.exp
watch-vfork.c
watch-vfork.exp
watch_thread_num.c
watch_thread_num.exp Skip watch_thread_num.exp on targets without access watchpoints 2015-05-08 12:50:47 +02:00
watchpoint-cond-gone-stripped.c
watchpoint-cond-gone.c
watchpoint-cond-gone.exp
watchpoint-delete.c
watchpoint-delete.exp
watchpoint-hw-hit-once.c
watchpoint-hw-hit-once.exp
watchpoint-hw.c
watchpoint-hw.exp
watchpoint-reuse-slot.c
watchpoint-reuse-slot.exp [arm] watchpoint-reuse-slot.exp: skip setting HW points on some address 2015-04-10 16:23:13 +01:00
watchpoint-solib-shr.c
watchpoint-solib.c
watchpoint-solib.exp Increase timeout in watch-bitfields.exp for software watchpoint 2015-04-15 12:46:58 +01:00
watchpoint-stops-at-right-insn.c
watchpoint-stops-at-right-insn.exp
watchpoint.c
watchpoint.exp
watchpoints.c
watchpoints.exp
wchar.c
wchar.exp
weaklib1.c
weaklib2.c
whatis-exp.exp
whatis.c
whatis.exp