diff options
author | Tom de Vries <tdevries@suse.de> | 2020-06-12 13:29:43 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2020-06-12 13:29:43 +0200 |
commit | 8c74a764f2cf5ea5e6997e35ba0f755fe2c09889 (patch) | |
tree | c845c9044ec75facfa8df2e9e7c5cc331ef7fe93 /gdb/testsuite/gdb.tui/basic.exp | |
parent | 26783bce15adc0316f9167a216519cebcf1ccac3 (diff) | |
download | fsf-binutils-gdb-8c74a764f2cf5ea5e6997e35ba0f755fe2c09889.zip fsf-binutils-gdb-8c74a764f2cf5ea5e6997e35ba0f755fe2c09889.tar.gz fsf-binutils-gdb-8c74a764f2cf5ea5e6997e35ba0f755fe2c09889.tar.bz2 |
[gdb/testsuite] Don't leak tuiterm.exp spawn override
In lib/tuiterm.exp the builtin spawn is overridden by a tui-specific version.
After running the first test-case that imports tuiterm.exp, the override
remains active, so it can cause trouble in subsequent test-cases, even if they
do not import tuiterm.exp. See f.i. commit c8d4f6dfd9 "[gdb/testsuite] Fix
spawn in tuiterm.exp".
Fix this by:
- adding a variable gdb_finish_hooks which is a list of procs to run during
gdb_finish
- adding a proc tuiterm_env that is used in test-cases instead of
"load_lib tuiterm.exp".
- letting tuiterm_env:
- install the tui-specific spawn version, and
- use the gdb_finish_hooks to schedule restoring the builtin spawn
version.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2020-06-12 Tom de Vries <tdevries@suse.de>
* lib/tuiterm.exp (spawn): Rename to ...
(tui_spawn): ... this.
(toplevel): Move rename of spawn ...
(gdb_init_tuiterm): ... here. New proc.
(gdb_finish_tuiterm): New proc.
* lib/gdb.exp (gdb_finish_hooks): New global var.
(gdb_finish): Handle gdb_finish_hooks.
(tuiterm_env): New proc.
* gdb.python/tui-window.exp: Replace load_lib tuiterm.exp with
tuiterm_env.
* gdb.tui/basic.exp: Same.
* gdb.tui/corefile-run.exp: Same.
* gdb.tui/empty.exp: Same.
* gdb.tui/list-before.exp: Same.
* gdb.tui/list.exp: Same.
* gdb.tui/main.exp: Same.
* gdb.tui/new-layout.exp: Same.
* gdb.tui/regs.exp: Same.
* gdb.tui/resize.exp: Same.
* gdb.tui/tui-layout-asm-short-prog.exp: Same.
* gdb.tui/tui-layout-asm.exp: Same.
* gdb.tui/tui-missing-src.exp: Same.
* gdb.tui/winheight.exp: Same.
Diffstat (limited to 'gdb/testsuite/gdb.tui/basic.exp')
-rw-r--r-- | gdb/testsuite/gdb.tui/basic.exp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.tui/basic.exp b/gdb/testsuite/gdb.tui/basic.exp index 34e6038..3e013a9 100644 --- a/gdb/testsuite/gdb.tui/basic.exp +++ b/gdb/testsuite/gdb.tui/basic.exp @@ -15,7 +15,7 @@ # Basic TUI tests. -load_lib "tuiterm.exp" +tuiterm_env standard_testfile tui-layout.c |