public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [committed][gdb/testsuite] Split up multi-exec test-cases
@ 2020-05-14 15:25 Tom de Vries
  2020-05-14 15:32 ` Tom Tromey
  2020-05-14 17:04 ` [committed][gdb/testsuite] Split up multi-exec test-cases Pedro Alves
  0 siblings, 2 replies; 8+ messages in thread
From: Tom de Vries @ 2020-05-14 15:25 UTC (permalink / raw)
  To: gdb-patches

Hi,

With test-case gdb.base/align.exp and target board native-gdbserver, we run
into:
...
(gdb) file outputs/gdb.base/align/c/align^M
Reading symbols from outputs/gdb.base/align/c/align...^M
(gdb) delete breakpoints^M
(gdb) info breakpoints^M
No breakpoints or watchpoints.^M
(gdb) break main^M
Breakpoint 1 at 0x4004ab: file outputs/gdb.base/align/c/align.c, line 838.^M
(gdb) kill^M
The program is not being run.^M
(gdb) spawn gdbserver --once localhost:2592 outputs/gdb.base/align/align^M
Process outputs/gdb.base/align/align created; pid = 6946^M
Listening on port 2592^M
target remote localhost:2592^M
Remote debugging using localhost:2592^M
warning: Mismatch between current exec-file outputs/gdb.base/align/c/align^M
and automatically determined exec-file outputs/gdb.base/align/align^M
exec-file-mismatch handling is currently "ask"^M
Load new symbol table from "outputs/gdb.base/align/align"? (y or n) Quit^M
(gdb) ERROR: test suppressed
...

Fix this by turning this and similar test-cases into regular, single
executable test-cases.

This fixes 100+ FAILs with target board native-gdbserver.

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Split up multi-exec test-cases

gdb/testsuite/ChangeLog:

2020-05-14  Tom de Vries  <tdevries@suse.de>

	* gdb.base/align.exp: Split into ...
	* gdb.base/align.exp.in: ...
	* gdb.base/align-c++.exp: ...
	* gdb.base/align-c.exp: ... these.
	* gdb.base/infcall-nested-structs.exp: Split into ...
	* gdb.base/infcall-nested-structs.exp.in: ...
	* gdb.base/infcall-nested-structs-c++.exp: ...
	* gdb.base/infcall-nested-structs-c.exp: ... these.
	* gdb.base/info-types.exp: Split into ...
	* gdb.base/info-types.exp.in: ...
	* gdb.base/info-types-c++.exp: ...
	* gdb.base/info-types-c.exp: ... these.
	* gdb.base/max-depth.exp: Split into ...
	* gdb.base/max-depth.exp.in: ...
	* gdb.base/max-depth-c++.exp: ...
	* gdb.base/max-depth-c.exp: ... these.
	* gdb.cp/infcall-nodebug.exp: Split into ...
	* gdb.cp/infcall-nodebug.exp.in: ...
	* gdb.cp/infcall-nodebug-c++-d0.exp: ...
	* gdb.cp/infcall-nodebug-c++-d1.exp: ...
	* gdb.cp/infcall-nodebug-c-d0.exp: ...
	* gdb.cp/infcall-nodebug-c-d1.exp: ... these.

---
 gdb/testsuite/gdb.base/align-c++.exp               | 27 ++++++++++++++++++++++
 gdb/testsuite/gdb.base/align-c.exp                 | 23 ++++++++++++++++++
 gdb/testsuite/gdb.base/{align.exp => align.exp.in} | 26 +++------------------
 .../gdb.base/infcall-nested-structs-c++.exp        | 24 +++++++++++++++++++
 .../gdb.base/infcall-nested-structs-c.exp          | 20 ++++++++++++++++
 ...d-structs.exp => infcall-nested-structs.exp.in} | 27 ++++------------------
 gdb/testsuite/gdb.base/info-types-c++.exp          | 22 ++++++++++++++++++
 gdb/testsuite/gdb.base/info-types-c.exp            | 18 +++++++++++++++
 .../gdb.base/{info-types.exp => info-types.exp.in} | 21 +++--------------
 gdb/testsuite/gdb.base/max-depth-c++.exp           | 22 ++++++++++++++++++
 gdb/testsuite/gdb.base/max-depth-c.exp             | 18 +++++++++++++++
 .../gdb.base/{max-depth.exp => max-depth.exp.in}   | 21 ++---------------
 gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp    | 25 ++++++++++++++++++++
 gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp    | 25 ++++++++++++++++++++
 gdb/testsuite/gdb.cp/infcall-nodebug-c-d0.exp      | 21 +++++++++++++++++
 gdb/testsuite/gdb.cp/infcall-nodebug-c-d1.exp      | 21 +++++++++++++++++
 ...{infcall-nodebug.exp => infcall-nodebug.exp.in} | 26 ++++-----------------
 17 files changed, 282 insertions(+), 105 deletions(-)

diff --git a/gdb/testsuite/gdb.base/align-c++.exp b/gdb/testsuite/gdb.base/align-c++.exp
new file mode 100644
index 0000000000..09632d8bfa
--- /dev/null
+++ b/gdb/testsuite/gdb.base/align-c++.exp
@@ -0,0 +1,27 @@
+# Copyright 2018-2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite
+
+# This tests that C++11 alignof works in gdb, and that it agrees with the
+# compiler.
+
+# Only test C++ if we are able.
+if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
+    return -1
+}
+set lang c++
+
+source $srcdir/$subdir/align.exp.in
diff --git a/gdb/testsuite/gdb.base/align-c.exp b/gdb/testsuite/gdb.base/align-c.exp
new file mode 100644
index 0000000000..d7852f4ea8
--- /dev/null
+++ b/gdb/testsuite/gdb.base/align-c.exp
@@ -0,0 +1,23 @@
+# Copyright 2018-2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite
+
+# This tests that C11 _Alignof works in gdb, and that it agrees with the
+# compiler.
+
+set lang c
+
+source $srcdir/$subdir/align.exp.in
diff --git a/gdb/testsuite/gdb.base/align.exp b/gdb/testsuite/gdb.base/align.exp.in
similarity index 87%
rename from gdb/testsuite/gdb.base/align.exp
rename to gdb/testsuite/gdb.base/align.exp.in
index 26827eb5a9..0653371c04 100644
--- a/gdb/testsuite/gdb.base/align.exp
+++ b/gdb/testsuite/gdb.base/align.exp.in
@@ -15,16 +15,6 @@
 
 # This file is part of the gdb testsuite
 
-# This tests that C11 _Alignof and C++11 alignof works in gdb, and
-# that it agrees with the compiler.
-
-# Only test C++ if we are able.  Always use C.
-if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
-    set lang {c}
-} else {
-    set lang {c c++}
-}
-
 # The types we're going to test.
 
 set typelist {
@@ -60,7 +50,7 @@ proc prepare_test_source_file { lang } {
 	set align_func "_Alignof"
     }
 
-    set filename [standard_output_file "$lang/align.$suffix"]
+    set filename [standard_output_file "align.$suffix"]
     set outfile [open $filename w]
 
     # Prologue.
@@ -140,7 +130,7 @@ proc run_alignment_test { lang } {
 	lappend flags "additional_flags=-std=c++11"
     }
     standard_testfile $filename
-    if {[prepare_for_testing "failed to prepare" "$lang/$testfile" $srcfile $flags]} {
+    if {[prepare_for_testing "failed to prepare" "$testfile" $srcfile $flags]} {
 	return -1
     }
 
@@ -186,14 +176,4 @@ proc run_alignment_test { lang } {
     }
 }
 
-# Create nested 'c' and 'c++' directories within this tests directory.
-foreach l $lang {
-    set dir "$l"
-    remote_exec host "rm -rf [standard_output_file ${dir}]"
-    remote_exec host "mkdir -p [standard_output_file ${dir}]"
-}
-
-# Now run the test for each language.
-foreach_with_prefix l $lang {
-    run_alignment_test $l
-}
+run_alignment_test $lang
diff --git a/gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp b/gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp
new file mode 100644
index 0000000000..9da0621384
--- /dev/null
+++ b/gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp
@@ -0,0 +1,24 @@
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2018-2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Only test C++ if we are able.
+if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
+    return -1
+}
+set lang c++
+
+source $srcdir/$subdir/infcall-nested-structs.exp.in
diff --git a/gdb/testsuite/gdb.base/infcall-nested-structs-c.exp b/gdb/testsuite/gdb.base/infcall-nested-structs-c.exp
new file mode 100644
index 0000000000..a715c5bd0d
--- /dev/null
+++ b/gdb/testsuite/gdb.base/infcall-nested-structs-c.exp
@@ -0,0 +1,20 @@
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2018-2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set lang {c}
+
+source $srcdir/$subdir/infcall-nested-structs.exp.in
diff --git a/gdb/testsuite/gdb.base/infcall-nested-structs.exp b/gdb/testsuite/gdb.base/infcall-nested-structs.exp.in
similarity index 90%
rename from gdb/testsuite/gdb.base/infcall-nested-structs.exp
rename to gdb/testsuite/gdb.base/infcall-nested-structs.exp.in
index 48c0373712..f7409612f8 100644
--- a/gdb/testsuite/gdb.base/infcall-nested-structs.exp
+++ b/gdb/testsuite/gdb.base/infcall-nested-structs.exp.in
@@ -15,7 +15,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-
 # Some targets can't call functions, so don't even bother with this
 # test.
 
@@ -24,20 +23,6 @@ if [target_info exists gdb,cannot_call_functions] {
     continue
 }
 
-# Only test C++ if we are able.  Always use C.
-if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
-    set lang {c}
-} else {
-    set lang {c c++}
-}
-
-foreach l $lang {
-    set dir "$l"
-    remote_exec host "rm -rf [standard_output_file ${dir}]"
-    remote_exec host "mkdir -p [standard_output_file ${dir}]"
-}
-
-
 set int_types { tc ts ti tl tll }
 set float_types { tf td tld }
 set complex_types { tfc tdc tldc }
@@ -67,8 +52,7 @@ proc start_nested_structs_test { lang types } {
     global srcdir
     global compile_flags
 
-    standard_testfile .c
-    set dir "$lang"
+    standard_testfile infcall-nested-structs.c
 
     # Create the additional flags
     set flags $compile_flags
@@ -82,7 +66,6 @@ proc start_nested_structs_test { lang types } {
 	append testfile "-" "$t"
     }
 
-    set binfile [standard_output_file ${dir}/${testfile}]
     if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags}"] != "" } {
 	unresolved "failed to compile"
 	return 0
@@ -161,11 +144,9 @@ proc start_gdb_and_run_tests { lang types } {
 	append prefix "-" "${t}"
     }
 
-    foreach_with_prefix l $lang {
-	with_test_prefix $prefix {
-	    if { [start_nested_structs_test $l $types] } {
-		run_tests $l $prefix
-	    }
+    with_test_prefix $prefix {
+	if { [start_nested_structs_test $lang $types] } {
+	    run_tests $lang $prefix
 	}
     }
 }
diff --git a/gdb/testsuite/gdb.base/info-types-c++.exp b/gdb/testsuite/gdb.base/info-types-c++.exp
new file mode 100644
index 0000000000..4f44369fe9
--- /dev/null
+++ b/gdb/testsuite/gdb.base/info-types-c++.exp
@@ -0,0 +1,22 @@
+# Copyright 2019-2020 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Only test C++ if we are able.
+if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
+    return -1
+}
+set lang c++
+
+source $srcdir/$subdir/info-types.exp.in
diff --git a/gdb/testsuite/gdb.base/info-types-c.exp b/gdb/testsuite/gdb.base/info-types-c.exp
new file mode 100644
index 0000000000..800d6389a4
--- /dev/null
+++ b/gdb/testsuite/gdb.base/info-types-c.exp
@@ -0,0 +1,18 @@
+# Copyright 2019-2020 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set lang {c}
+
+source $srcdir/$subdir/info-types.exp.in
diff --git a/gdb/testsuite/gdb.base/info-types.exp b/gdb/testsuite/gdb.base/info-types.exp.in
similarity index 90%
rename from gdb/testsuite/gdb.base/info-types.exp
rename to gdb/testsuite/gdb.base/info-types.exp.in
index 7cce756e92..8c065b1c5f 100644
--- a/gdb/testsuite/gdb.base/info-types.exp
+++ b/gdb/testsuite/gdb.base/info-types.exp.in
@@ -16,19 +16,6 @@
 # Check that 'info types' produces the expected output for an inferior
 # containing a number of different types.
 
-# Only test C++ if we are able.  Always use C.
-if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
-    set lang {c}
-} else {
-    set lang {c c++}
-}
-
-foreach l $lang {
-    set dir "$l"
-    remote_exec host "rm -rf [standard_output_file ${dir}]"
-    remote_exec host "mkdir -p [standard_output_file ${dir}]"
-}
-
 # Run 'info types' test, compiling the test file for language LANG,
 # which should be either 'c' or 'c++'.
 proc run_test { lang } {
@@ -39,10 +26,10 @@ proc run_test { lang } {
     global srcdir
     global compile_flags
 
-    standard_testfile .c
+    standard_testfile info-types.c
 
     if {[prepare_for_testing "failed to prepare" \
-	     "${lang}/${testfile}" $srcfile "debug $lang"]} {
+	     "${testfile}" $srcfile "debug $lang"]} {
 	return -1
     }
 
@@ -140,6 +127,4 @@ proc run_test { lang } {
     }
 }
 
-foreach_with_prefix l $lang {
-    run_test $l
-}
+run_test $lang
diff --git a/gdb/testsuite/gdb.base/max-depth-c++.exp b/gdb/testsuite/gdb.base/max-depth-c++.exp
new file mode 100644
index 0000000000..b88b2c118d
--- /dev/null
+++ b/gdb/testsuite/gdb.base/max-depth-c++.exp
@@ -0,0 +1,22 @@
+# Copyright 2019-2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Only test C++ if we are able.
+if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
+    return -1
+}
+set lang c++
+
+source $srcdir/$subdir/max-depth.exp.in
diff --git a/gdb/testsuite/gdb.base/max-depth-c.exp b/gdb/testsuite/gdb.base/max-depth-c.exp
new file mode 100644
index 0000000000..3bd93098d2
--- /dev/null
+++ b/gdb/testsuite/gdb.base/max-depth-c.exp
@@ -0,0 +1,18 @@
+# Copyright 2019-2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set lang {c}
+
+source $srcdir/$subdir/max-depth.exp.in
diff --git a/gdb/testsuite/gdb.base/max-depth.exp b/gdb/testsuite/gdb.base/max-depth.exp.in
similarity index 94%
rename from gdb/testsuite/gdb.base/max-depth.exp
rename to gdb/testsuite/gdb.base/max-depth.exp.in
index 7a0fe2455a..8c0d7120d1 100644
--- a/gdb/testsuite/gdb.base/max-depth.exp
+++ b/gdb/testsuite/gdb.base/max-depth.exp.in
@@ -15,26 +15,13 @@
 
 # Tests GDB's handling of 'set print max-depth'.
 
-# Only test C++ if we are able.  Always use C.
-if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
-    set lang {c}
-} else {
-    set lang {c c++}
-}
-
-foreach l $lang {
-    set dir "$l"
-    remote_exec host "rm -rf [standard_output_file ${dir}]"
-    remote_exec host "mkdir -p [standard_output_file ${dir}]"
-}
-
 proc compile_and_run_tests { lang } {
     global testfile
     global srcfile
     global binfile
     global hex
 
-    standard_testfile .c
+    standard_testfile max-depth.c
 
     # Create the additional flags.
     set flags "debug"
@@ -43,8 +30,6 @@ proc compile_and_run_tests { lang } {
 	lappend flags "additional_flags=-std=c++11"
     }
 
-    set dir "$lang"
-    set binfile [standard_output_file ${dir}/${testfile}]
     if { [prepare_for_testing "failed to prepare" "${binfile}" "${srcfile}" "${flags}"] } {
 	return 0
     }
@@ -163,6 +148,4 @@ proc compile_and_run_tests { lang } {
     }
 }
 
-foreach_with_prefix l $lang {
-    compile_and_run_tests $l
-}
+compile_and_run_tests $lang
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp
new file mode 100644
index 0000000000..f06ab08628
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp
@@ -0,0 +1,25 @@
+# This testcase is part of GDB, the GNU debugger.
+# Copyright 2018-2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Only test C++ if we are able.  Always use C.
+if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
+    return -1
+}
+set lang {c++}
+
+set debug nodebug
+
+source $srcdir/$subdir/infcall-nodebug.exp.in
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp
new file mode 100644
index 0000000000..d9dd14faf9
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp
@@ -0,0 +1,25 @@
+# This testcase is part of GDB, the GNU debugger.
+# Copyright 2018-2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Only test C++ if we are able.  Always use C.
+if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
+    return -1
+}
+set lang {c++}
+
+set debug debug
+
+source $srcdir/$subdir/infcall-nodebug.exp.in
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug-c-d0.exp b/gdb/testsuite/gdb.cp/infcall-nodebug-c-d0.exp
new file mode 100644
index 0000000000..cd65dd036a
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/infcall-nodebug-c-d0.exp
@@ -0,0 +1,21 @@
+# This testcase is part of GDB, the GNU debugger.
+# Copyright 2018-2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set lang {c}
+
+set debug nodebug
+
+source $srcdir/$subdir/infcall-nodebug.exp.in
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug-c-d1.exp b/gdb/testsuite/gdb.cp/infcall-nodebug-c-d1.exp
new file mode 100644
index 0000000000..4cb26ad3fd
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/infcall-nodebug-c-d1.exp
@@ -0,0 +1,21 @@
+# This testcase is part of GDB, the GNU debugger.
+# Copyright 2018-2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set lang {c}
+
+set debug debug
+
+source $srcdir/$subdir/infcall-nodebug.exp.in
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug.exp b/gdb/testsuite/gdb.cp/infcall-nodebug.exp.in
similarity index 82%
rename from gdb/testsuite/gdb.cp/infcall-nodebug.exp
rename to gdb/testsuite/gdb.cp/infcall-nodebug.exp.in
index 53d080dfcd..2346619627 100644
--- a/gdb/testsuite/gdb.cp/infcall-nodebug.exp
+++ b/gdb/testsuite/gdb.cp/infcall-nodebug.exp.in
@@ -24,13 +24,6 @@ if [target_info exists gdb,cannot_call_functions] {
     continue
 }
 
-# Only test C++ if we are able.  Always use C.
-if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
-    set lang {c}
-} else {
-    set lang {c c++}
-}
-
 set main_basename infcall-nodebug-main
 set lib_basename infcall-nodebug-lib
 standard_testfile ${main_basename}.c ${lib_basename}.c
@@ -53,19 +46,13 @@ proc build_and_run_test { lang symbols } {
 	set debug_flags ""
     }
 
-    # Setup directory.
-
-    set dir "$lang-$symbols"
-    remote_exec build "rm -rf [standard_output_file ${dir}]"
-    remote_exec build "mkdir -p [standard_output_file ${dir}]"
-
     # Compile both files to objects, then link together.
 
     set main_flags "$lang debug"
     set lib_flags "$lang $debug_flags"
-    set main_o [standard_output_file ${dir}/${main_basename}.o]
-    set lib_o [standard_output_file ${dir}/${lib_basename}.o]
-    set binfile [standard_output_file ${dir}/${testfile}]
+    set main_o [standard_output_file ${main_basename}.o]
+    set lib_o [standard_output_file ${lib_basename}.o]
+    set binfile [standard_output_file ${testfile}]
 
     if { [gdb_compile $mainsrc $main_o object ${main_flags}] != "" } {
 	untested "failed to compile main file to object"
@@ -111,9 +98,4 @@ proc build_and_run_test { lang symbols } {
 
 }
 
-foreach_with_prefix l $lang {
-    foreach_with_prefix s {debug nodebug} {
-	build_and_run_test $l $s
-    }
-}
-
+build_and_run_test $lang $debug

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [committed][gdb/testsuite] Split up multi-exec test-cases
  2020-05-14 15:25 [committed][gdb/testsuite] Split up multi-exec test-cases Tom de Vries
@ 2020-05-14 15:32 ` Tom Tromey
  2020-05-14 16:28   ` Tom de Vries
  2020-05-14 17:04 ` [committed][gdb/testsuite] Split up multi-exec test-cases Pedro Alves
  1 sibling, 1 reply; 8+ messages in thread
From: Tom Tromey @ 2020-05-14 15:32 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> Fix this by turning this and similar test-cases into regular, single
Tom> executable test-cases.

Tom> This fixes 100+ FAILs with target board native-gdbserver.

I don't have any issue with splitting, however I wonder...

Tom> 	* gdb.base/align.exp.in: ...

... if we should have a different suffix than ".in".
To me ".in" normally implies that it's processed by configure or the like.

Could we just call these ".tcl" files?  If dejagnu would ignore those,
then that would work out great.

Tom

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [committed][gdb/testsuite] Split up multi-exec test-cases
  2020-05-14 15:32 ` Tom Tromey
@ 2020-05-14 16:28   ` Tom de Vries
  2020-05-14 17:14     ` Pedro Alves
  2020-05-15 12:51     ` [committed][gdb/testsuite] Rename *.exp.in to *.exp.tcl Tom de Vries
  0 siblings, 2 replies; 8+ messages in thread
From: Tom de Vries @ 2020-05-14 16:28 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches, Pedro Alves

[-- Attachment #1: Type: text/plain, Size: 1485 bytes --]

On 14-05-2020 17:32, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> Fix this by turning this and similar test-cases into regular, single
> Tom> executable test-cases.
> 
> Tom> This fixes 100+ FAILs with target board native-gdbserver.
> 
> I don't have any issue with splitting, however I wonder...
> 
> Tom> 	* gdb.base/align.exp.in: ...
> 
> ... if we should have a different suffix than ".in".
> To me ".in" normally implies that it's processed by configure or the like.
> 

FWIW, I based this pattern on:
...
$ ls -1  gdb/testsuite/gdb.base/all-architecture*
gdb/testsuite/gdb.base/all-architectures-0.exp
gdb/testsuite/gdb.base/all-architectures-1.exp
gdb/testsuite/gdb.base/all-architectures-2.exp
gdb/testsuite/gdb.base/all-architectures-3.exp
gdb/testsuite/gdb.base/all-architectures-4.exp
gdb/testsuite/gdb.base/all-architectures-5.exp
gdb/testsuite/gdb.base/all-architectures-6.exp
gdb/testsuite/gdb.base/all-architectures-7.exp
gdb/testsuite/gdb.base/all-architectures.exp.in
...

I'm guessing .in was short for include.

> Could we just call these ".tcl" files?  If dejagnu would ignore those,
> then that would work out great.

Testing attached patch, renaming *.exp.in to *.exp.tcl.

That leaves just:
...
$ find gdb/testsuite/gdb.* -type f -name "*.in"
gdb/testsuite/gdb.guile/scm-objfile-script-gdb.in
gdb/testsuite/gdb.python/py-framefilter-invalidarg-gdb.py.in
gdb/testsuite/gdb.python/py-framefilter-gdb.py.in
...

Thanks,
- Tom

[-- Attachment #2: 0001-gdb-testsuite-Rename-.exp.in-to-.exp.tcl.patch --]
[-- Type: text/x-patch, Size: 14914 bytes --]

[gdb/testsuite] Rename *.exp.in to *.exp.tcl

---
 gdb/testsuite/gdb.base/align-c++.exp                                    | 2 +-
 gdb/testsuite/gdb.base/align-c.exp                                      | 2 +-
 gdb/testsuite/gdb.base/{align.exp.in => align.exp.tcl}                  | 0
 gdb/testsuite/gdb.base/all-architectures-0.exp                          | 2 +-
 gdb/testsuite/gdb.base/all-architectures-1.exp                          | 2 +-
 gdb/testsuite/gdb.base/all-architectures-2.exp                          | 2 +-
 gdb/testsuite/gdb.base/all-architectures-3.exp                          | 2 +-
 gdb/testsuite/gdb.base/all-architectures-4.exp                          | 2 +-
 gdb/testsuite/gdb.base/all-architectures-5.exp                          | 2 +-
 gdb/testsuite/gdb.base/all-architectures-6.exp                          | 2 +-
 gdb/testsuite/gdb.base/all-architectures-7.exp                          | 2 +-
 .../gdb.base/{all-architectures.exp.in => all-architectures.exp.tcl}    | 0
 gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp                   | 2 +-
 gdb/testsuite/gdb.base/infcall-nested-structs-c.exp                     | 2 +-
 .../{infcall-nested-structs.exp.in => infcall-nested-structs.exp.tcl}   | 0
 gdb/testsuite/gdb.base/info-types-c++.exp                               | 2 +-
 gdb/testsuite/gdb.base/info-types-c.exp                                 | 2 +-
 gdb/testsuite/gdb.base/{info-types.exp.in => info-types.exp.tcl}        | 0
 gdb/testsuite/gdb.base/max-depth-c++.exp                                | 2 +-
 gdb/testsuite/gdb.base/max-depth-c.exp                                  | 2 +-
 gdb/testsuite/gdb.base/{max-depth.exp.in => max-depth.exp.tcl}          | 0
 gdb/testsuite/gdb.cp/cpexprs-debug-types.exp                            | 2 +-
 gdb/testsuite/gdb.cp/cpexprs.exp                                        | 2 +-
 gdb/testsuite/gdb.cp/{cpexprs.exp.in => cpexprs.exp.tcl}                | 0
 gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp                         | 2 +-
 gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp                         | 2 +-
 gdb/testsuite/gdb.cp/infcall-nodebug-c-d0.exp                           | 2 +-
 gdb/testsuite/gdb.cp/infcall-nodebug-c-d1.exp                           | 2 +-
 .../gdb.cp/{infcall-nodebug.exp.in => infcall-nodebug.exp.tcl}          | 0
 gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp                        | 2 +-
 gdb/testsuite/gdb.dwarf2/clang-debug-names.exp                          | 2 +-
 .../gdb.dwarf2/{clang-debug-names.exp.in => clang-debug-names.exp.tcl}  | 0
 32 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/gdb/testsuite/gdb.base/align-c++.exp b/gdb/testsuite/gdb.base/align-c++.exp
index 09632d8bfa..6266d11282 100644
--- a/gdb/testsuite/gdb.base/align-c++.exp
+++ b/gdb/testsuite/gdb.base/align-c++.exp
@@ -24,4 +24,4 @@ if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
 }
 set lang c++
 
-source $srcdir/$subdir/align.exp.in
+source $srcdir/$subdir/align.exp.tcl
diff --git a/gdb/testsuite/gdb.base/align-c.exp b/gdb/testsuite/gdb.base/align-c.exp
index d7852f4ea8..d42abc8d38 100644
--- a/gdb/testsuite/gdb.base/align-c.exp
+++ b/gdb/testsuite/gdb.base/align-c.exp
@@ -20,4 +20,4 @@
 
 set lang c
 
-source $srcdir/$subdir/align.exp.in
+source $srcdir/$subdir/align.exp.tcl
diff --git a/gdb/testsuite/gdb.base/align.exp.in b/gdb/testsuite/gdb.base/align.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.base/align.exp.in
rename to gdb/testsuite/gdb.base/align.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-0.exp b/gdb/testsuite/gdb.base/all-architectures-0.exp
index 767daac9ff..d861c41aff 100644
--- a/gdb/testsuite/gdb.base/all-architectures-0.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-0.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 0
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-1.exp b/gdb/testsuite/gdb.base/all-architectures-1.exp
index 91aad9dc86..0e6379eea5 100644
--- a/gdb/testsuite/gdb.base/all-architectures-1.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-1.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 1
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-2.exp b/gdb/testsuite/gdb.base/all-architectures-2.exp
index c24a332bc2..6216d48a7c 100644
--- a/gdb/testsuite/gdb.base/all-architectures-2.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-2.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 2
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-3.exp b/gdb/testsuite/gdb.base/all-architectures-3.exp
index a88a38b3a9..bd873a9666 100644
--- a/gdb/testsuite/gdb.base/all-architectures-3.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-3.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 3
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-4.exp b/gdb/testsuite/gdb.base/all-architectures-4.exp
index f6c9fc4cef..17b0160036 100644
--- a/gdb/testsuite/gdb.base/all-architectures-4.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-4.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 4
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-5.exp b/gdb/testsuite/gdb.base/all-architectures-5.exp
index e84441be4a..613ae6fdf1 100644
--- a/gdb/testsuite/gdb.base/all-architectures-5.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-5.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 5
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-6.exp b/gdb/testsuite/gdb.base/all-architectures-6.exp
index 702b5237d2..3dceb5e1f8 100644
--- a/gdb/testsuite/gdb.base/all-architectures-6.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-6.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 6
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-7.exp b/gdb/testsuite/gdb.base/all-architectures-7.exp
index 2d0705b384..ba7640ce44 100644
--- a/gdb/testsuite/gdb.base/all-architectures-7.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-7.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 7
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures.exp.in b/gdb/testsuite/gdb.base/all-architectures.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.base/all-architectures.exp.in
rename to gdb/testsuite/gdb.base/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp b/gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp
index 9da0621384..4741e0dade 100644
--- a/gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp
+++ b/gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp
@@ -21,4 +21,4 @@ if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
 }
 set lang c++
 
-source $srcdir/$subdir/infcall-nested-structs.exp.in
+source $srcdir/$subdir/infcall-nested-structs.exp.tcl
diff --git a/gdb/testsuite/gdb.base/infcall-nested-structs-c.exp b/gdb/testsuite/gdb.base/infcall-nested-structs-c.exp
index a715c5bd0d..1e876e331a 100644
--- a/gdb/testsuite/gdb.base/infcall-nested-structs-c.exp
+++ b/gdb/testsuite/gdb.base/infcall-nested-structs-c.exp
@@ -17,4 +17,4 @@
 
 set lang {c}
 
-source $srcdir/$subdir/infcall-nested-structs.exp.in
+source $srcdir/$subdir/infcall-nested-structs.exp.tcl
diff --git a/gdb/testsuite/gdb.base/infcall-nested-structs.exp.in b/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.base/infcall-nested-structs.exp.in
rename to gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl
diff --git a/gdb/testsuite/gdb.base/info-types-c++.exp b/gdb/testsuite/gdb.base/info-types-c++.exp
index 4f44369fe9..587a39f55f 100644
--- a/gdb/testsuite/gdb.base/info-types-c++.exp
+++ b/gdb/testsuite/gdb.base/info-types-c++.exp
@@ -19,4 +19,4 @@ if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
 }
 set lang c++
 
-source $srcdir/$subdir/info-types.exp.in
+source $srcdir/$subdir/info-types.exp.tcl
diff --git a/gdb/testsuite/gdb.base/info-types-c.exp b/gdb/testsuite/gdb.base/info-types-c.exp
index 800d6389a4..0b6e81d5b2 100644
--- a/gdb/testsuite/gdb.base/info-types-c.exp
+++ b/gdb/testsuite/gdb.base/info-types-c.exp
@@ -15,4 +15,4 @@
 
 set lang {c}
 
-source $srcdir/$subdir/info-types.exp.in
+source $srcdir/$subdir/info-types.exp.tcl
diff --git a/gdb/testsuite/gdb.base/info-types.exp.in b/gdb/testsuite/gdb.base/info-types.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.base/info-types.exp.in
rename to gdb/testsuite/gdb.base/info-types.exp.tcl
diff --git a/gdb/testsuite/gdb.base/max-depth-c++.exp b/gdb/testsuite/gdb.base/max-depth-c++.exp
index b88b2c118d..9f732d004f 100644
--- a/gdb/testsuite/gdb.base/max-depth-c++.exp
+++ b/gdb/testsuite/gdb.base/max-depth-c++.exp
@@ -19,4 +19,4 @@ if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
 }
 set lang c++
 
-source $srcdir/$subdir/max-depth.exp.in
+source $srcdir/$subdir/max-depth.exp.tcl
diff --git a/gdb/testsuite/gdb.base/max-depth-c.exp b/gdb/testsuite/gdb.base/max-depth-c.exp
index 3bd93098d2..765772087d 100644
--- a/gdb/testsuite/gdb.base/max-depth-c.exp
+++ b/gdb/testsuite/gdb.base/max-depth-c.exp
@@ -15,4 +15,4 @@
 
 set lang {c}
 
-source $srcdir/$subdir/max-depth.exp.in
+source $srcdir/$subdir/max-depth.exp.tcl
diff --git a/gdb/testsuite/gdb.base/max-depth.exp.in b/gdb/testsuite/gdb.base/max-depth.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.base/max-depth.exp.in
rename to gdb/testsuite/gdb.base/max-depth.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/cpexprs-debug-types.exp b/gdb/testsuite/gdb.cp/cpexprs-debug-types.exp
index b93f2e8c15..ece7bc9acd 100644
--- a/gdb/testsuite/gdb.cp/cpexprs-debug-types.exp
+++ b/gdb/testsuite/gdb.cp/cpexprs-debug-types.exp
@@ -17,4 +17,4 @@
 
 # Run cpexprs.exp with -fdebug-types-section.
 set flags {additional_flags=-fdebug-types-section}
-source $srcdir/$subdir/cpexprs.exp.in
+source $srcdir/$subdir/cpexprs.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/cpexprs.exp b/gdb/testsuite/gdb.cp/cpexprs.exp
index b16a5ea6e3..62f13a38e8 100644
--- a/gdb/testsuite/gdb.cp/cpexprs.exp
+++ b/gdb/testsuite/gdb.cp/cpexprs.exp
@@ -21,4 +21,4 @@
 
 # Run cpexprs.exp.
 set flags {}
-source $srcdir/$subdir/cpexprs.exp.in
+source $srcdir/$subdir/cpexprs.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/cpexprs.exp.in b/gdb/testsuite/gdb.cp/cpexprs.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.cp/cpexprs.exp.in
rename to gdb/testsuite/gdb.cp/cpexprs.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp
index f06ab08628..806d03b0e2 100644
--- a/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp
+++ b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp
@@ -22,4 +22,4 @@ set lang {c++}
 
 set debug nodebug
 
-source $srcdir/$subdir/infcall-nodebug.exp.in
+source $srcdir/$subdir/infcall-nodebug.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp
index d9dd14faf9..dfafe52afb 100644
--- a/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp
+++ b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp
@@ -22,4 +22,4 @@ set lang {c++}
 
 set debug debug
 
-source $srcdir/$subdir/infcall-nodebug.exp.in
+source $srcdir/$subdir/infcall-nodebug.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug-c-d0.exp b/gdb/testsuite/gdb.cp/infcall-nodebug-c-d0.exp
index cd65dd036a..b74f9333f8 100644
--- a/gdb/testsuite/gdb.cp/infcall-nodebug-c-d0.exp
+++ b/gdb/testsuite/gdb.cp/infcall-nodebug-c-d0.exp
@@ -18,4 +18,4 @@ set lang {c}
 
 set debug nodebug
 
-source $srcdir/$subdir/infcall-nodebug.exp.in
+source $srcdir/$subdir/infcall-nodebug.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug-c-d1.exp b/gdb/testsuite/gdb.cp/infcall-nodebug-c-d1.exp
index 4cb26ad3fd..b9d68637ae 100644
--- a/gdb/testsuite/gdb.cp/infcall-nodebug-c-d1.exp
+++ b/gdb/testsuite/gdb.cp/infcall-nodebug-c-d1.exp
@@ -18,4 +18,4 @@ set lang {c}
 
 set debug debug
 
-source $srcdir/$subdir/infcall-nodebug.exp.in
+source $srcdir/$subdir/infcall-nodebug.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug.exp.in b/gdb/testsuite/gdb.cp/infcall-nodebug.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.cp/infcall-nodebug.exp.in
rename to gdb/testsuite/gdb.cp/infcall-nodebug.exp.tcl
diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp b/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp
index 185dddfc73..43d7801c0d 100644
--- a/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp
+++ b/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp
@@ -29,7 +29,7 @@ lassign \
     main_start main_length
 
 set asm_file [standard_output_file $srcfile2]
-source $srcdir/$subdir/clang-debug-names.exp.in
+source $srcdir/$subdir/clang-debug-names.exp.tcl
 
 if { [build_executable_from_specs "failed to prepare" ${testfile} "" \
 	  $srcfile "nodebug" $asm_file "nodebug" $srcfile3 "debug"] } {
diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
index b5af898838..149c1263c9 100644
--- a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
+++ b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
@@ -26,7 +26,7 @@ lassign [function_range main ${srcdir}/${subdir}/${srcfile}] \
     main_start main_length
 
 set asm_file [standard_output_file $srcfile2]
-source $srcdir/$subdir/clang-debug-names.exp.in
+source $srcdir/$subdir/clang-debug-names.exp.tcl
 
 if { [prepare_for_testing "failed to prepare" ${testfile} \
 	  [list $srcfile $asm_file] {nodebug}] } {
diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp.in b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.dwarf2/clang-debug-names.exp.in
rename to gdb/testsuite/gdb.dwarf2/clang-debug-names.exp.tcl

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [committed][gdb/testsuite] Split up multi-exec test-cases
  2020-05-14 15:25 [committed][gdb/testsuite] Split up multi-exec test-cases Tom de Vries
  2020-05-14 15:32 ` Tom Tromey
@ 2020-05-14 17:04 ` Pedro Alves
  2020-05-15 14:27   ` Tom de Vries
  2020-05-18 14:13   ` Pedro Alves
  1 sibling, 2 replies; 8+ messages in thread
From: Pedro Alves @ 2020-05-14 17:04 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches

On 5/14/20 4:25 PM, Tom de Vries wrote:
> (gdb) spawn gdbserver --once localhost:2592 outputs/gdb.base/align/align^M
> Process outputs/gdb.base/align/align created; pid = 6946^M
> Listening on port 2592^M
> target remote localhost:2592^M
> Remote debugging using localhost:2592^M
> warning: Mismatch between current exec-file outputs/gdb.base/align/c/align^M
> and automatically determined exec-file outputs/gdb.base/align/align^M
> exec-file-mismatch handling is currently "ask"^M
> Load new symbol table from "outputs/gdb.base/align/align"? (y or n) Quit^M
> (gdb) ERROR: test suppressed
> ...

No objection to the splitting, but the issue above should really be
fixed.  It's a systematic issue, and requiring a file split to address it
seems like a heavy burden to me.  Maybe we should disable exec-file-mismatch
detection from within gdb_target_cmd?  At least, until we have buildid detection.
But that won't work on all hosts, either.  Like, this fixes align.exp for me:

diff --git c/gdb/testsuite/lib/gdbserver-support.exp w/gdb/testsuite/lib/gdbserver-support.exp
index a2cc80f28d7..fc79f1d60c6 100644
--- c/gdb/testsuite/lib/gdbserver-support.exp
+++ w/gdb/testsuite/lib/gdbserver-support.exp
@@ -52,7 +52,7 @@ proc gdb_target_cmd_ext { targetname serialport {additional_text ""} } {
 
     set serialport_re [string_to_regexp $serialport]
     for {set i 1} {$i <= 3} {incr i} {
-       send_gdb "target $targetname $serialport\n"
+       send_gdb "with exec-file-mismatch off -- target $targetname $serialport\n"
        gdb_expect 60 {
            -re "A program is being debugged already.*ill it.*y or n. $" {
                send_gdb "y\n"


Thanks,
Pedro Alves


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [committed][gdb/testsuite] Split up multi-exec test-cases
  2020-05-14 16:28   ` Tom de Vries
@ 2020-05-14 17:14     ` Pedro Alves
  2020-05-15 12:51     ` [committed][gdb/testsuite] Rename *.exp.in to *.exp.tcl Tom de Vries
  1 sibling, 0 replies; 8+ messages in thread
From: Pedro Alves @ 2020-05-14 17:14 UTC (permalink / raw)
  To: Tom de Vries, Tom Tromey; +Cc: gdb-patches

On 5/14/20 5:28 PM, Tom de Vries wrote:

> FWIW, I based this pattern on:
> ...
> $ ls -1  gdb/testsuite/gdb.base/all-architecture*
> gdb/testsuite/gdb.base/all-architectures-0.exp
> gdb/testsuite/gdb.base/all-architectures-1.exp
> gdb/testsuite/gdb.base/all-architectures-2.exp
> gdb/testsuite/gdb.base/all-architectures-3.exp
> gdb/testsuite/gdb.base/all-architectures-4.exp
> gdb/testsuite/gdb.base/all-architectures-5.exp
> gdb/testsuite/gdb.base/all-architectures-6.exp
> gdb/testsuite/gdb.base/all-architectures-7.exp
> gdb/testsuite/gdb.base/all-architectures.exp.in
> ...
> 
> I'm guessing .in was short for include.

Yeah, include or input.

> 
>> Could we just call these ".tcl" files?  If dejagnu would ignore those,
>> then that would work out great.
> 

No objection (with my the-one-who-added-all-architectures.exp.in originally hat).

Thanks,
Pedro Alves


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [committed][gdb/testsuite] Rename *.exp.in to *.exp.tcl
  2020-05-14 16:28   ` Tom de Vries
  2020-05-14 17:14     ` Pedro Alves
@ 2020-05-15 12:51     ` Tom de Vries
  1 sibling, 0 replies; 8+ messages in thread
From: Tom de Vries @ 2020-05-15 12:51 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Pedro Alves, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1688 bytes --]

[ was: Re: [committed][gdb/testsuite] Split up multi-exec test-cases ]

On 14-05-2020 18:28, Tom de Vries wrote:
> On 14-05-2020 17:32, Tom Tromey wrote:
>>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
>>
>> Tom> Fix this by turning this and similar test-cases into regular, single
>> Tom> executable test-cases.
>>
>> Tom> This fixes 100+ FAILs with target board native-gdbserver.
>>
>> I don't have any issue with splitting, however I wonder...
>>
>> Tom> 	* gdb.base/align.exp.in: ...
>>
>> ... if we should have a different suffix than ".in".
>> To me ".in" normally implies that it's processed by configure or the like.
>>
> 
> FWIW, I based this pattern on:
> ...
> $ ls -1  gdb/testsuite/gdb.base/all-architecture*
> gdb/testsuite/gdb.base/all-architectures-0.exp
> gdb/testsuite/gdb.base/all-architectures-1.exp
> gdb/testsuite/gdb.base/all-architectures-2.exp
> gdb/testsuite/gdb.base/all-architectures-3.exp
> gdb/testsuite/gdb.base/all-architectures-4.exp
> gdb/testsuite/gdb.base/all-architectures-5.exp
> gdb/testsuite/gdb.base/all-architectures-6.exp
> gdb/testsuite/gdb.base/all-architectures-7.exp
> gdb/testsuite/gdb.base/all-architectures.exp.in
> ...
> 
> I'm guessing .in was short for include.
> 
>> Could we just call these ".tcl" files?  If dejagnu would ignore those,
>> then that would work out great.
> 
> Testing attached patch, renaming *.exp.in to *.exp.tcl.
> 
> That leaves just:
> ...
> $ find gdb/testsuite/gdb.* -type f -name "*.in"
> gdb/testsuite/gdb.guile/scm-objfile-script-gdb.in
> gdb/testsuite/gdb.python/py-framefilter-invalidarg-gdb.py.in
> gdb/testsuite/gdb.python/py-framefilter-gdb.py.in
> ...

Committed as attached.

Thanks,
- Tom

[-- Attachment #2: 0001-gdb-testsuite-Rename-.exp.in-to-.exp.tcl.patch --]
[-- Type: text/x-patch, Size: 17213 bytes --]

[gdb/testsuite] Rename *.exp.in to *.exp.tcl

Say we have some common tcl code that we want to include in test-cases
t1.exp and t1.exp.

We could put the common code into a file common.exp alongside the test-cases,
but that will make dejagnu treat that file as another test-case.  To prevent
this, we use a suffix, currently .in, in other words we put the common code in
a file common.exp.in.

The .in suffix however is also used in autoconf, which might cause confusion.

Change the suffix from .in to .tcl.

gdb/testsuite/ChangeLog:

2020-05-15  Tom de Vries  <tdevries@suse.de>

	* gdb.base/align.exp.in: Rename to ...
	* gdb.base/align.exp.tcl: ... this.
	* gdb.base/align-c++.exp: Update.
	* gdb.base/align-c.exp: Update.
	* gdb.base/all-architectures.exp.in: Rename to ...
	* gdb.base/all-architectures.exp: ... this.
	* gdb.base/all-architectures-0.exp: Update.
	* gdb.base/all-architectures-1.exp: Update.
	* gdb.base/all-architectures-2.exp: Update.
	* gdb.base/all-architectures-3.exp: Update.
	* gdb.base/all-architectures-4.exp: Update.
	* gdb.base/all-architectures-5.exp: Update.
	* gdb.base/all-architectures-6.exp: Update.
	* gdb.base/all-architectures-7.exp: Update.
	* gdb.base/infcall-nested-structs.exp.in: Rename to ...
	* gdb.base/infcall-nested-structs.exp.tcl: ... this.
	* gdb.base/infcall-nested-structs-c++.exp: Update.
	* gdb.base/infcall-nested-structs-c.exp: Update.
	* gdb.base/info-types.exp.in: Rename to ...
	* gdb.base/info-types.exp.tcl: ... this.
	* gdb.base/info-types-c++.exp: Update.
	* gdb.base/info-types-c.exp: Update.
	* gdb.base/max-depth.exp.in: Rename to ...
	* gdb.base/max-depth.exp.tcl: ... this.
	* gdb.base/max-depth-c++.exp: Update.
	* gdb.base/max-depth-c.exp: Update.
	* gdb.cp/cpexprs.exp.in: Rename to ...
	* gdb.cp/cpexprs.exp.tcl: ... this.
	* gdb.cp/cpexprs-debug-types.exp: Update.
	* gdb.cp/cpexprs.exp: Update.
	* gdb.cp/infcall-nodebug.exp.in: Rename to ...
	* gdb.cp/infcall-nodebug.exp.tcl: ... this.
	* gdb.cp/infcall-nodebug-c++-d0.exp: Update.
	* gdb.cp/infcall-nodebug-c++-d1.exp: Update.
	* gdb.cp/infcall-nodebug-c-d0.exp: Update.
	* gdb.cp/infcall-nodebug-c-d1.exp: Update.
	* gdb.dwarf2/clang-debug-names.exp.in: Rename to ...
	* gdb.dwarf2/clang-debug-names.exp.tcl: ... this.
	* gdb.dwarf2/clang-debug-names-2.exp: Update.
	* gdb.dwarf2/clang-debug-names.exp: Update.

---
 gdb/testsuite/gdb.base/align-c++.exp                                    | 2 +-
 gdb/testsuite/gdb.base/align-c.exp                                      | 2 +-
 gdb/testsuite/gdb.base/{align.exp.in => align.exp.tcl}                  | 0
 gdb/testsuite/gdb.base/all-architectures-0.exp                          | 2 +-
 gdb/testsuite/gdb.base/all-architectures-1.exp                          | 2 +-
 gdb/testsuite/gdb.base/all-architectures-2.exp                          | 2 +-
 gdb/testsuite/gdb.base/all-architectures-3.exp                          | 2 +-
 gdb/testsuite/gdb.base/all-architectures-4.exp                          | 2 +-
 gdb/testsuite/gdb.base/all-architectures-5.exp                          | 2 +-
 gdb/testsuite/gdb.base/all-architectures-6.exp                          | 2 +-
 gdb/testsuite/gdb.base/all-architectures-7.exp                          | 2 +-
 .../gdb.base/{all-architectures.exp.in => all-architectures.exp.tcl}    | 0
 gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp                   | 2 +-
 gdb/testsuite/gdb.base/infcall-nested-structs-c.exp                     | 2 +-
 .../{infcall-nested-structs.exp.in => infcall-nested-structs.exp.tcl}   | 0
 gdb/testsuite/gdb.base/info-types-c++.exp                               | 2 +-
 gdb/testsuite/gdb.base/info-types-c.exp                                 | 2 +-
 gdb/testsuite/gdb.base/{info-types.exp.in => info-types.exp.tcl}        | 0
 gdb/testsuite/gdb.base/max-depth-c++.exp                                | 2 +-
 gdb/testsuite/gdb.base/max-depth-c.exp                                  | 2 +-
 gdb/testsuite/gdb.base/{max-depth.exp.in => max-depth.exp.tcl}          | 0
 gdb/testsuite/gdb.cp/cpexprs-debug-types.exp                            | 2 +-
 gdb/testsuite/gdb.cp/cpexprs.exp                                        | 2 +-
 gdb/testsuite/gdb.cp/{cpexprs.exp.in => cpexprs.exp.tcl}                | 0
 gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp                         | 2 +-
 gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp                         | 2 +-
 gdb/testsuite/gdb.cp/infcall-nodebug-c-d0.exp                           | 2 +-
 gdb/testsuite/gdb.cp/infcall-nodebug-c-d1.exp                           | 2 +-
 .../gdb.cp/{infcall-nodebug.exp.in => infcall-nodebug.exp.tcl}          | 0
 gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp                        | 2 +-
 gdb/testsuite/gdb.dwarf2/clang-debug-names.exp                          | 2 +-
 .../gdb.dwarf2/{clang-debug-names.exp.in => clang-debug-names.exp.tcl}  | 0
 32 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/gdb/testsuite/gdb.base/align-c++.exp b/gdb/testsuite/gdb.base/align-c++.exp
index 09632d8bfa..6266d11282 100644
--- a/gdb/testsuite/gdb.base/align-c++.exp
+++ b/gdb/testsuite/gdb.base/align-c++.exp
@@ -24,4 +24,4 @@ if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
 }
 set lang c++
 
-source $srcdir/$subdir/align.exp.in
+source $srcdir/$subdir/align.exp.tcl
diff --git a/gdb/testsuite/gdb.base/align-c.exp b/gdb/testsuite/gdb.base/align-c.exp
index d7852f4ea8..d42abc8d38 100644
--- a/gdb/testsuite/gdb.base/align-c.exp
+++ b/gdb/testsuite/gdb.base/align-c.exp
@@ -20,4 +20,4 @@
 
 set lang c
 
-source $srcdir/$subdir/align.exp.in
+source $srcdir/$subdir/align.exp.tcl
diff --git a/gdb/testsuite/gdb.base/align.exp.in b/gdb/testsuite/gdb.base/align.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.base/align.exp.in
rename to gdb/testsuite/gdb.base/align.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-0.exp b/gdb/testsuite/gdb.base/all-architectures-0.exp
index 767daac9ff..d861c41aff 100644
--- a/gdb/testsuite/gdb.base/all-architectures-0.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-0.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 0
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-1.exp b/gdb/testsuite/gdb.base/all-architectures-1.exp
index 91aad9dc86..0e6379eea5 100644
--- a/gdb/testsuite/gdb.base/all-architectures-1.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-1.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 1
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-2.exp b/gdb/testsuite/gdb.base/all-architectures-2.exp
index c24a332bc2..6216d48a7c 100644
--- a/gdb/testsuite/gdb.base/all-architectures-2.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-2.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 2
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-3.exp b/gdb/testsuite/gdb.base/all-architectures-3.exp
index a88a38b3a9..bd873a9666 100644
--- a/gdb/testsuite/gdb.base/all-architectures-3.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-3.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 3
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-4.exp b/gdb/testsuite/gdb.base/all-architectures-4.exp
index f6c9fc4cef..17b0160036 100644
--- a/gdb/testsuite/gdb.base/all-architectures-4.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-4.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 4
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-5.exp b/gdb/testsuite/gdb.base/all-architectures-5.exp
index e84441be4a..613ae6fdf1 100644
--- a/gdb/testsuite/gdb.base/all-architectures-5.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-5.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 5
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-6.exp b/gdb/testsuite/gdb.base/all-architectures-6.exp
index 702b5237d2..3dceb5e1f8 100644
--- a/gdb/testsuite/gdb.base/all-architectures-6.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-6.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 6
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures-7.exp b/gdb/testsuite/gdb.base/all-architectures-7.exp
index 2d0705b384..ba7640ce44 100644
--- a/gdb/testsuite/gdb.base/all-architectures-7.exp
+++ b/gdb/testsuite/gdb.base/all-architectures-7.exp
@@ -14,4 +14,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 set test_slice 7
-source $srcdir/$subdir/all-architectures.exp.in
+source $srcdir/$subdir/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/all-architectures.exp.in b/gdb/testsuite/gdb.base/all-architectures.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.base/all-architectures.exp.in
rename to gdb/testsuite/gdb.base/all-architectures.exp.tcl
diff --git a/gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp b/gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp
index 9da0621384..4741e0dade 100644
--- a/gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp
+++ b/gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp
@@ -21,4 +21,4 @@ if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
 }
 set lang c++
 
-source $srcdir/$subdir/infcall-nested-structs.exp.in
+source $srcdir/$subdir/infcall-nested-structs.exp.tcl
diff --git a/gdb/testsuite/gdb.base/infcall-nested-structs-c.exp b/gdb/testsuite/gdb.base/infcall-nested-structs-c.exp
index a715c5bd0d..1e876e331a 100644
--- a/gdb/testsuite/gdb.base/infcall-nested-structs-c.exp
+++ b/gdb/testsuite/gdb.base/infcall-nested-structs-c.exp
@@ -17,4 +17,4 @@
 
 set lang {c}
 
-source $srcdir/$subdir/infcall-nested-structs.exp.in
+source $srcdir/$subdir/infcall-nested-structs.exp.tcl
diff --git a/gdb/testsuite/gdb.base/infcall-nested-structs.exp.in b/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.base/infcall-nested-structs.exp.in
rename to gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl
diff --git a/gdb/testsuite/gdb.base/info-types-c++.exp b/gdb/testsuite/gdb.base/info-types-c++.exp
index 4f44369fe9..587a39f55f 100644
--- a/gdb/testsuite/gdb.base/info-types-c++.exp
+++ b/gdb/testsuite/gdb.base/info-types-c++.exp
@@ -19,4 +19,4 @@ if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
 }
 set lang c++
 
-source $srcdir/$subdir/info-types.exp.in
+source $srcdir/$subdir/info-types.exp.tcl
diff --git a/gdb/testsuite/gdb.base/info-types-c.exp b/gdb/testsuite/gdb.base/info-types-c.exp
index 800d6389a4..0b6e81d5b2 100644
--- a/gdb/testsuite/gdb.base/info-types-c.exp
+++ b/gdb/testsuite/gdb.base/info-types-c.exp
@@ -15,4 +15,4 @@
 
 set lang {c}
 
-source $srcdir/$subdir/info-types.exp.in
+source $srcdir/$subdir/info-types.exp.tcl
diff --git a/gdb/testsuite/gdb.base/info-types.exp.in b/gdb/testsuite/gdb.base/info-types.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.base/info-types.exp.in
rename to gdb/testsuite/gdb.base/info-types.exp.tcl
diff --git a/gdb/testsuite/gdb.base/max-depth-c++.exp b/gdb/testsuite/gdb.base/max-depth-c++.exp
index b88b2c118d..9f732d004f 100644
--- a/gdb/testsuite/gdb.base/max-depth-c++.exp
+++ b/gdb/testsuite/gdb.base/max-depth-c++.exp
@@ -19,4 +19,4 @@ if { [skip_cplus_tests] || [get_compiler_info "c++"] } {
 }
 set lang c++
 
-source $srcdir/$subdir/max-depth.exp.in
+source $srcdir/$subdir/max-depth.exp.tcl
diff --git a/gdb/testsuite/gdb.base/max-depth-c.exp b/gdb/testsuite/gdb.base/max-depth-c.exp
index 3bd93098d2..765772087d 100644
--- a/gdb/testsuite/gdb.base/max-depth-c.exp
+++ b/gdb/testsuite/gdb.base/max-depth-c.exp
@@ -15,4 +15,4 @@
 
 set lang {c}
 
-source $srcdir/$subdir/max-depth.exp.in
+source $srcdir/$subdir/max-depth.exp.tcl
diff --git a/gdb/testsuite/gdb.base/max-depth.exp.in b/gdb/testsuite/gdb.base/max-depth.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.base/max-depth.exp.in
rename to gdb/testsuite/gdb.base/max-depth.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/cpexprs-debug-types.exp b/gdb/testsuite/gdb.cp/cpexprs-debug-types.exp
index b93f2e8c15..ece7bc9acd 100644
--- a/gdb/testsuite/gdb.cp/cpexprs-debug-types.exp
+++ b/gdb/testsuite/gdb.cp/cpexprs-debug-types.exp
@@ -17,4 +17,4 @@
 
 # Run cpexprs.exp with -fdebug-types-section.
 set flags {additional_flags=-fdebug-types-section}
-source $srcdir/$subdir/cpexprs.exp.in
+source $srcdir/$subdir/cpexprs.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/cpexprs.exp b/gdb/testsuite/gdb.cp/cpexprs.exp
index b16a5ea6e3..62f13a38e8 100644
--- a/gdb/testsuite/gdb.cp/cpexprs.exp
+++ b/gdb/testsuite/gdb.cp/cpexprs.exp
@@ -21,4 +21,4 @@
 
 # Run cpexprs.exp.
 set flags {}
-source $srcdir/$subdir/cpexprs.exp.in
+source $srcdir/$subdir/cpexprs.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/cpexprs.exp.in b/gdb/testsuite/gdb.cp/cpexprs.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.cp/cpexprs.exp.in
rename to gdb/testsuite/gdb.cp/cpexprs.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp
index f06ab08628..806d03b0e2 100644
--- a/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp
+++ b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp
@@ -22,4 +22,4 @@ set lang {c++}
 
 set debug nodebug
 
-source $srcdir/$subdir/infcall-nodebug.exp.in
+source $srcdir/$subdir/infcall-nodebug.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp
index d9dd14faf9..dfafe52afb 100644
--- a/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp
+++ b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp
@@ -22,4 +22,4 @@ set lang {c++}
 
 set debug debug
 
-source $srcdir/$subdir/infcall-nodebug.exp.in
+source $srcdir/$subdir/infcall-nodebug.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug-c-d0.exp b/gdb/testsuite/gdb.cp/infcall-nodebug-c-d0.exp
index cd65dd036a..b74f9333f8 100644
--- a/gdb/testsuite/gdb.cp/infcall-nodebug-c-d0.exp
+++ b/gdb/testsuite/gdb.cp/infcall-nodebug-c-d0.exp
@@ -18,4 +18,4 @@ set lang {c}
 
 set debug nodebug
 
-source $srcdir/$subdir/infcall-nodebug.exp.in
+source $srcdir/$subdir/infcall-nodebug.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug-c-d1.exp b/gdb/testsuite/gdb.cp/infcall-nodebug-c-d1.exp
index 4cb26ad3fd..b9d68637ae 100644
--- a/gdb/testsuite/gdb.cp/infcall-nodebug-c-d1.exp
+++ b/gdb/testsuite/gdb.cp/infcall-nodebug-c-d1.exp
@@ -18,4 +18,4 @@ set lang {c}
 
 set debug debug
 
-source $srcdir/$subdir/infcall-nodebug.exp.in
+source $srcdir/$subdir/infcall-nodebug.exp.tcl
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug.exp.in b/gdb/testsuite/gdb.cp/infcall-nodebug.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.cp/infcall-nodebug.exp.in
rename to gdb/testsuite/gdb.cp/infcall-nodebug.exp.tcl
diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp b/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp
index 185dddfc73..43d7801c0d 100644
--- a/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp
+++ b/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp
@@ -29,7 +29,7 @@ lassign \
     main_start main_length
 
 set asm_file [standard_output_file $srcfile2]
-source $srcdir/$subdir/clang-debug-names.exp.in
+source $srcdir/$subdir/clang-debug-names.exp.tcl
 
 if { [build_executable_from_specs "failed to prepare" ${testfile} "" \
 	  $srcfile "nodebug" $asm_file "nodebug" $srcfile3 "debug"] } {
diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
index b5af898838..149c1263c9 100644
--- a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
+++ b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
@@ -26,7 +26,7 @@ lassign [function_range main ${srcdir}/${subdir}/${srcfile}] \
     main_start main_length
 
 set asm_file [standard_output_file $srcfile2]
-source $srcdir/$subdir/clang-debug-names.exp.in
+source $srcdir/$subdir/clang-debug-names.exp.tcl
 
 if { [prepare_for_testing "failed to prepare" ${testfile} \
 	  [list $srcfile $asm_file] {nodebug}] } {
diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp.in b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp.tcl
similarity index 100%
rename from gdb/testsuite/gdb.dwarf2/clang-debug-names.exp.in
rename to gdb/testsuite/gdb.dwarf2/clang-debug-names.exp.tcl

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [committed][gdb/testsuite] Split up multi-exec test-cases
  2020-05-14 17:04 ` [committed][gdb/testsuite] Split up multi-exec test-cases Pedro Alves
@ 2020-05-15 14:27   ` Tom de Vries
  2020-05-18 14:13   ` Pedro Alves
  1 sibling, 0 replies; 8+ messages in thread
From: Tom de Vries @ 2020-05-15 14:27 UTC (permalink / raw)
  To: Pedro Alves, gdb-patches

On 14-05-2020 19:04, Pedro Alves wrote:
> On 5/14/20 4:25 PM, Tom de Vries wrote:
>> (gdb) spawn gdbserver --once localhost:2592 outputs/gdb.base/align/align^M
>> Process outputs/gdb.base/align/align created; pid = 6946^M
>> Listening on port 2592^M
>> target remote localhost:2592^M
>> Remote debugging using localhost:2592^M
>> warning: Mismatch between current exec-file outputs/gdb.base/align/c/align^M
>> and automatically determined exec-file outputs/gdb.base/align/align^M
>> exec-file-mismatch handling is currently "ask"^M
>> Load new symbol table from "outputs/gdb.base/align/align"? (y or n) Quit^M
>> (gdb) ERROR: test suppressed
>> ...
> 
> No objection to the splitting, but the issue above should really be
> fixed.
>  It's a systematic issue, and requiring a file split to address it
> seems like a heavy burden to me.

Agreed, not all locations where we run into this problem can be
fixed/worked-around like that, I just saw an opportunity to trivially
reduce test-case complexity with substantial failcount reduction payoff.

>  Maybe we should disable exec-file-mismatch
> detection from within gdb_target_cmd?  At least, until we have buildid detection.
> But that won't work on all hosts, either.  Like, this fixes align.exp for me:
> 
> diff --git c/gdb/testsuite/lib/gdbserver-support.exp w/gdb/testsuite/lib/gdbserver-support.exp
> index a2cc80f28d7..fc79f1d60c6 100644
> --- c/gdb/testsuite/lib/gdbserver-support.exp
> +++ w/gdb/testsuite/lib/gdbserver-support.exp
> @@ -52,7 +52,7 @@ proc gdb_target_cmd_ext { targetname serialport {additional_text ""} } {
>  
>      set serialport_re [string_to_regexp $serialport]
>      for {set i 1} {$i <= 3} {incr i} {
> -       send_gdb "target $targetname $serialport\n"
> +       send_gdb "with exec-file-mismatch off -- target $targetname $serialport\n"
>         gdb_expect 60 {
>             -re "A program is being debugged already.*ill it.*y or n. $" {
>                 send_gdb "y\n"
> 

That's neat, I tried myself this:
...
diff --git a/gdb/testsuite/lib/gdbserver-support.exp
b/gdb/testsuite/lib/gdbserver-support.exp
index a2cc80f28d..66c9bf8549 100644
--- a/gdb/testsuite/lib/gdbserver-support.exp
+++ b/gdb/testsuite/lib/gdbserver-support.exp
@@ -58,6 +58,11 @@ proc gdb_target_cmd_ext { targetname serialport
{additional_text ""} } {
                send_gdb "y\n"
                exp_continue
            }
+           -re "Load new symbol table from \[^\r\n\]*\\? \\(y or n\\) $" {
+               send_gdb "y\n"
+               gdb_test "" ""
+               return 0
+           }
            -re "unknown host.*$gdb_prompt" {
                verbose "Couldn't look up $serialport"
            }
...
but I think your solution is better.

Thanks,
- Tom

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [committed][gdb/testsuite] Split up multi-exec test-cases
  2020-05-14 17:04 ` [committed][gdb/testsuite] Split up multi-exec test-cases Pedro Alves
  2020-05-15 14:27   ` Tom de Vries
@ 2020-05-18 14:13   ` Pedro Alves
  1 sibling, 0 replies; 8+ messages in thread
From: Pedro Alves @ 2020-05-18 14:13 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches

On 5/14/20 6:04 PM, Pedro Alves via Gdb-patches wrote:
> On 5/14/20 4:25 PM, Tom de Vries wrote:

> No objection to the splitting, but the issue above should really be
> fixed.  It's a systematic issue, and requiring a file split to address it
> seems like a heavy burden to me.  Maybe we should disable exec-file-mismatch
> detection from within gdb_target_cmd?  At least, until we have buildid detection.
> But that won't work on all hosts, either.  Like, this fixes align.exp for me:
> 
> diff --git c/gdb/testsuite/lib/gdbserver-support.exp w/gdb/testsuite/lib/gdbserver-support.exp
> index a2cc80f28d7..fc79f1d60c6 100644
> --- c/gdb/testsuite/lib/gdbserver-support.exp
> +++ w/gdb/testsuite/lib/gdbserver-support.exp
> @@ -52,7 +52,7 @@ proc gdb_target_cmd_ext { targetname serialport {additional_text ""} } {
>  
>      set serialport_re [string_to_regexp $serialport]
>      for {set i 1} {$i <= 3} {incr i} {
> -       send_gdb "target $targetname $serialport\n"
> +       send_gdb "with exec-file-mismatch off -- target $targetname $serialport\n"
>         gdb_expect 60 {
>             -re "A program is being debugged already.*ill it.*y or n. $" {
>                 send_gdb "y\n"
To sort of close the loop here -- I no longer think that this a good approach.

The exec-file-mismatch detection did actually find a bug in the testsuite:
 https://sourceware.org/pipermail/gdb-patches/2020-May/168680.html

I'm now aiming at fixing this in GDB, by making GDB validate the exec 
file by comparing build IDs instead of filenames:
  https://sourceware.org/pipermail/gdb-patches/2020-May/168718.html

Thanks,
Pedro Alves


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-18 14:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-14 15:25 [committed][gdb/testsuite] Split up multi-exec test-cases Tom de Vries
2020-05-14 15:32 ` Tom Tromey
2020-05-14 16:28   ` Tom de Vries
2020-05-14 17:14     ` Pedro Alves
2020-05-15 12:51     ` [committed][gdb/testsuite] Rename *.exp.in to *.exp.tcl Tom de Vries
2020-05-14 17:04 ` [committed][gdb/testsuite] Split up multi-exec test-cases Pedro Alves
2020-05-15 14:27   ` Tom de Vries
2020-05-18 14:13   ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).