diff options
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 18 |
2 files changed, 23 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 0523f7c..ff834b7 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2020-06-12 Tom de Vries <tdevries@suse.de> + + PR testsuite/26110 + * lib/gdb.exp (gdb_init): Revert dejagnu's override of ::unknown. + (gdb_finish): Reinstall dejagnu's override of ::unknown. + 2020-06-11 Tom Tromey <tom@tromey.com> PR gdb/18318: diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 51f8a05..64e667c 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -5193,7 +5193,19 @@ proc gdb_init { test_file_name } { global gdb_instances set gdb_instances 0 - return [default_gdb_init $test_file_name] + set res [default_gdb_init $test_file_name] + + # Dejagnu overrides proc unknown. The dejagnu version may trigger in a + # test-case but abort the entire test run. To fix this, we install a + # local version here, which reverts dejagnu's override, and restore + # dejagnu's version in gdb_finish. + rename ::unknown ::dejagnu_unknown + proc unknown { args } { + # Dejagnu saves the original version in ::tcl_unknown, use it. + return [uplevel 1 ::tcl_unknown $args] + } + + return $res } proc gdb_finish { } { @@ -5201,6 +5213,10 @@ proc gdb_finish { } { global gdb_prompt global cleanfiles + # Restore dejagnu's version of proc unknown. + rename ::unknown "" + rename ::dejagnu_unknown ::unknown + # Exit first, so that the files are no longer in use. gdb_exit |