8sa1-binutils-gdb/gdb/testsuite/lib
Tom de Vries a8a566853a [gdb/testsuite] Move code from gdb_init to default_gdb_init
If a baseboard file wants to override a proc foo, but also use the original
proc, it'll have to do something like:
...
rename foo save_foo
proc foo { } {
    ...
    set res [save_foo]
    ...
    return res
}
...
This adds a new proc named save_foo, which introduces the risk of clashing with
an existing proc.

There's a pattern in the gdb testsuite procs, that facilitates this override:
...
proc default_foo { } {
  ...
}

proc foo { } {
    return [default_foo]
}
...
such that in a baseboard file we don't need the rename:
...
proc foo { } {
    ...
    set res [default_foo]
    ...
    return res
}
...

The exception to the pattern though is gdb_init, which has a default_gdb_init
counterpart, but contains much more code than just the call to
default_gdb_init.

Fix this by moving all but the call to default_gdb_init to default_gdb_init.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-06-18  Tom de Vries  <tdevries@suse.de>

	* lib/gdb.exp (gdb_init): Move all but call to default_gdb_init to ...
	(default_gdb_init): ... here.
2020-06-18 15:06:04 +02:00
..
ada.exp
append_gdb_boards_dir.exp
build-piece.exp
cache.exp
check-test-names.exp gdb/testsuite: Revert commit 843f4d9357 2020-05-15 11:48:57 +01:00
cl_util.c
cl_util.h
compile-support.exp
compiler.c
compiler.cc
completion-support.exp
cp-support.exp
d-support.exp
data-structures.exp
dtrace.exp
dwarf.exp
fortran.exp
future.exp
gdb-guile.exp
gdb-python.exp
gdb-utils.exp Revert "Add completion styling" 2020-05-24 20:27:48 -06:00
gdb.exp [gdb/testsuite] Move code from gdb_init to default_gdb_init 2020-06-18 15:06:04 +02:00
gdbserver-support.exp
gen-perf-test.exp
gnat_debug_info_test.adb
go.exp
jit-elf-helpers.exp [gdb/testsuite] Fix var use in compile_and_download_n_jit_so 2020-05-25 12:28:54 +02:00
memory.exp
mi-support.exp
objc.exp
opencl_hostapp.c
opencl_kernel.cl
opencl.exp
pascal.exp gdb/testsuite: Prevent globals leaking between test scripts 2020-06-12 15:09:33 +02:00
pdtrace.in
perftest.exp
prelink-support.exp
prompt.exp
range-stepping-support.exp
read1.c
rust-support.exp
selftest-support.exp
set_unbuffered_mode.c
sym-info-cmds.exp
trace-support.exp
tuiterm.exp [gdb/testsuite] Don't leak tuiterm.exp spawn override 2020-06-12 13:29:43 +02:00
unbuffer_output.c
valgrind.exp