aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/tui-window.exp
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-06-12 13:29:43 +0200
committerTom de Vries <tdevries@suse.de>2020-06-12 13:29:43 +0200
commit8c74a764f2cf5ea5e6997e35ba0f755fe2c09889 (patch)
treec845c9044ec75facfa8df2e9e7c5cc331ef7fe93 /gdb/testsuite/gdb.python/tui-window.exp
parent26783bce15adc0316f9167a216519cebcf1ccac3 (diff)
downloadgdb-8c74a764f2cf5ea5e6997e35ba0f755fe2c09889.zip
gdb-8c74a764f2cf5ea5e6997e35ba0f755fe2c09889.tar.gz
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.python/tui-window.exp')
-rw-r--r--gdb/testsuite/gdb.python/tui-window.exp2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.python/tui-window.exp b/gdb/testsuite/gdb.python/tui-window.exp
index 1a4feeb..503823a 100644
--- a/gdb/testsuite/gdb.python/tui-window.exp
+++ b/gdb/testsuite/gdb.python/tui-window.exp
@@ -16,7 +16,7 @@
# Test a TUI window implemented in Python.
load_lib gdb-python.exp
-load_lib tuiterm.exp
+tuiterm_env
# This test doesn't care about the inferior.
standard_testfile py-arch.c