This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfa] Skip thread test flag in testsuite/gdb.threads/*.exp
- From: Markus Deuling <deuling at de dot ibm dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>
- Date: Thu, 13 Sep 2007 07:39:11 +0200
- Subject: [rfa] Skip thread test flag in testsuite/gdb.threads/*.exp
Hi,
on SPU targets there are no threads available. Wenn running the testsuite all tests in gdb.threads are marked as unsupproted due to fail of gdb_compile_pthreads (no pthread library for SPU). This patchs adds a check to all those testcase for a flag to set in a target board file:
set_board_info gdb,skip_thread_tests 1
With this flag you can easily switch of thread tests for your target board. The advantage of this solution is a much cleaner log file. I see a lot of annoying compiler errors in gdb.log all the time
I run the testsuite on SPU.
What do you think? Would that be ok for mainline?
ChangeLog:
* testsuite/gdb.threads/bp_in_thread.exp: Skip test if
skip_thread_tests is set for target board.
Likewise for gcore-thread.exp, killed.exp, linux-dp.exp,
manythreads.exp, print-threads.exp, pthread_cond_wait.exp, pthreads.exp,
schedlock.exp, sigthread.exp, step2.exp, step.exp, switch-threads.exp,
threadapply.exp, thread_check.exp, thread-specific.exp, tls.exp,
tls-nodebug.exp, tls-shared.exp, watchthreads.exp, staticthreads.exp.
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
diff -urpN src/gdb/testsuite/gdb.threads/bp_in_thread.exp dev/gdb/testsuite/gdb.threads/bp_in_thread.exp
--- src/gdb/testsuite/gdb.threads/bp_in_thread.exp 2007-08-24 04:24:31.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/bp_in_thread.exp 2007-09-13 07:24:54.000000000 +0200
@@ -18,6 +18,11 @@
# GDB reported a SIGTRAP signal in a random thread when hitting
# a breakpoint.
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel then {
strace $tracelevel
}
diff -urpN src/gdb/testsuite/gdb.threads/gcore-thread.exp dev/gdb/testsuite/gdb.threads/gcore-thread.exp
--- src/gdb/testsuite/gdb.threads/gcore-thread.exp 2007-08-24 04:24:31.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/gcore-thread.exp 2007-09-13 07:25:17.000000000 +0200
@@ -19,6 +19,11 @@
# This file was written by Michael Snyder (msnyder@redhat.com)
# This is a test for the gdb command "generate-core-file".
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel then {
strace $tracelevel
}
diff -urpN src/gdb/testsuite/gdb.threads/killed.exp dev/gdb/testsuite/gdb.threads/killed.exp
--- src/gdb/testsuite/gdb.threads/killed.exp 2007-08-24 04:24:31.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/killed.exp 2007-09-13 07:25:33.000000000 +0200
@@ -54,6 +54,11 @@
# [7]+ Killed $D6/gdb/gdb -nw killed
# $
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel then {
strace $tracelevel
}
diff -urpN src/gdb/testsuite/gdb.threads/linux-dp.exp dev/gdb/testsuite/gdb.threads/linux-dp.exp
--- src/gdb/testsuite/gdb.threads/linux-dp.exp 2007-08-24 04:24:31.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/linux-dp.exp 2007-09-13 07:25:49.000000000 +0200
@@ -34,6 +34,11 @@
### killing and restarting
### quitting gracefully
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel then {
strace $tracelevel
}
diff -urpN src/gdb/testsuite/gdb.threads/manythreads.exp dev/gdb/testsuite/gdb.threads/manythreads.exp
--- src/gdb/testsuite/gdb.threads/manythreads.exp 2007-08-24 04:24:31.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/manythreads.exp 2007-09-13 07:26:04.000000000 +0200
@@ -19,6 +19,11 @@
# This file was written by Jeff Johnston. (jjohnstn@redhat.com)
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel then {
strace $tracelevel
}
diff -urpN src/gdb/testsuite/gdb.threads/print-threads.exp dev/gdb/testsuite/gdb.threads/print-threads.exp
--- src/gdb/testsuite/gdb.threads/print-threads.exp 2007-08-24 04:24:31.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/print-threads.exp 2007-09-13 07:26:24.000000000 +0200
@@ -22,6 +22,11 @@
# It tests miscellaneous actions with multiple threads, including
# handling for thread exit.
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel then {
strace $tracelevel
}
diff -urpN src/gdb/testsuite/gdb.threads/pthread_cond_wait.exp dev/gdb/testsuite/gdb.threads/pthread_cond_wait.exp
--- src/gdb/testsuite/gdb.threads/pthread_cond_wait.exp 2007-08-24 04:24:32.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/pthread_cond_wait.exp 2007-09-13 07:26:44.000000000 +0200
@@ -19,6 +19,11 @@
# This file verifies that GDB is able to compute a backtrace for a thread
# being blocked on a call to pthread_cond_wait().
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel then {
strace $tracelevel
}
diff -urpN src/gdb/testsuite/gdb.threads/pthreads.exp dev/gdb/testsuite/gdb.threads/pthreads.exp
--- src/gdb/testsuite/gdb.threads/pthreads.exp 2007-08-24 04:24:32.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/pthreads.exp 2007-09-13 07:27:08.000000000 +0200
@@ -19,6 +19,11 @@
# This file was written by Fred Fish. (fnf@cygnus.com)
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel then {
strace $tracelevel
}
diff -urpN src/gdb/testsuite/gdb.threads/schedlock.exp dev/gdb/testsuite/gdb.threads/schedlock.exp
--- src/gdb/testsuite/gdb.threads/schedlock.exp 2007-08-24 04:24:32.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/schedlock.exp 2007-09-13 07:27:21.000000000 +0200
@@ -21,6 +21,11 @@
#
# This test covers the various forms of "set scheduler-locking".
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel then {
strace $tracelevel
}
diff -urpN src/gdb/testsuite/gdb.threads/sigthread.exp dev/gdb/testsuite/gdb.threads/sigthread.exp
--- src/gdb/testsuite/gdb.threads/sigthread.exp 2007-08-24 04:24:32.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/sigthread.exp 2007-09-13 07:20:35.000000000 +0200
@@ -14,6 +14,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. */
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
set testfile sigthread
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
diff -urpN src/gdb/testsuite/gdb.threads/staticthreads.exp dev/gdb/testsuite/gdb.threads/staticthreads.exp
--- src/gdb/testsuite/gdb.threads/staticthreads.exp 2007-08-24 04:24:32.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/staticthreads.exp 2007-09-13 07:27:47.000000000 +0200
@@ -18,6 +18,11 @@
# Based on manythreads written by Jeff Johnston, contributed by Red
# Hat.
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel then {
strace $tracelevel
}
diff -urpN src/gdb/testsuite/gdb.threads/step2.exp dev/gdb/testsuite/gdb.threads/step2.exp
--- src/gdb/testsuite/gdb.threads/step2.exp 2007-08-24 04:24:32.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/step2.exp 2007-09-13 07:21:02.000000000 +0200
@@ -20,6 +20,10 @@
# This file was written by Jeff Law. (law@cygnus.com)
#
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
if $tracelevel then {
strace $tracelevel
diff -urpN src/gdb/testsuite/gdb.threads/step.exp dev/gdb/testsuite/gdb.threads/step.exp
--- src/gdb/testsuite/gdb.threads/step.exp 2007-08-24 04:24:32.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/step.exp 2007-09-13 07:21:19.000000000 +0200
@@ -35,6 +35,10 @@
# places. (see previous bullet -- this test doesn't
# catch the fact it continued rather than stepped)
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
if $tracelevel then {
strace $tracelevel
diff -urpN src/gdb/testsuite/gdb.threads/switch-threads.exp dev/gdb/testsuite/gdb.threads/switch-threads.exp
--- src/gdb/testsuite/gdb.threads/switch-threads.exp 2007-08-24 04:24:32.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/switch-threads.exp 2007-09-13 07:21:47.000000000 +0200
@@ -26,6 +26,11 @@
# TODO: we should also test explicitly changing threads with the "thread"
# command.
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel then {
strace $tracelevel
}
diff -urpN src/gdb/testsuite/gdb.threads/threadapply.exp dev/gdb/testsuite/gdb.threads/threadapply.exp
--- src/gdb/testsuite/gdb.threads/threadapply.exp 2007-08-24 04:24:32.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/threadapply.exp 2007-09-13 07:22:07.000000000 +0200
@@ -15,6 +15,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel {
strace $tracelevel
}
diff -urpN src/gdb/testsuite/gdb.threads/thread_check.exp dev/gdb/testsuite/gdb.threads/thread_check.exp
--- src/gdb/testsuite/gdb.threads/thread_check.exp 2007-08-24 04:24:32.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/thread_check.exp 2007-09-13 07:22:41.000000000 +0200
@@ -34,6 +34,11 @@
# - delete all breakpoints
# - exit gdb.
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel then {
strace $tracelevel
}
diff -urpN src/gdb/testsuite/gdb.threads/thread-specific.exp dev/gdb/testsuite/gdb.threads/thread-specific.exp
--- src/gdb/testsuite/gdb.threads/thread-specific.exp 2007-08-24 04:24:32.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/thread-specific.exp 2007-09-13 07:22:56.000000000 +0200
@@ -20,6 +20,11 @@
# It tests that the correct breakpoint is reported when we hit a
# thread-specific breakpoint inserted for several threads.
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel then {
strace $tracelevel
}
diff -urpN src/gdb/testsuite/gdb.threads/tls.exp dev/gdb/testsuite/gdb.threads/tls.exp
--- src/gdb/testsuite/gdb.threads/tls.exp 2007-08-24 04:24:32.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/tls.exp 2007-09-13 07:23:26.000000000 +0200
@@ -17,6 +17,11 @@
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
set testfile tls
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
diff -urpN src/gdb/testsuite/gdb.threads/tls-nodebug.exp dev/gdb/testsuite/gdb.threads/tls-nodebug.exp
--- src/gdb/testsuite/gdb.threads/tls-nodebug.exp 2007-08-24 04:24:32.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/tls-nodebug.exp 2007-09-13 07:23:43.000000000 +0200
@@ -17,6 +17,11 @@
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
set testfile tls-nodebug
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
diff -urpN src/gdb/testsuite/gdb.threads/tls-shared.exp dev/gdb/testsuite/gdb.threads/tls-shared.exp
--- src/gdb/testsuite/gdb.threads/tls-shared.exp 2007-08-24 04:24:32.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/tls-shared.exp 2007-09-13 07:24:10.000000000 +0200
@@ -19,6 +19,11 @@
# tls-shared.exp -- Expect script to test thread local storage in gdb, with
# shared libraries.
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel then {
strace $tracelevel
}
diff -urpN src/gdb/testsuite/gdb.threads/watchthreads.exp dev/gdb/testsuite/gdb.threads/watchthreads.exp
--- src/gdb/testsuite/gdb.threads/watchthreads.exp 2007-08-24 04:24:32.000000000 +0200
+++ dev/gdb/testsuite/gdb.threads/watchthreads.exp 2007-09-13 07:24:27.000000000 +0200
@@ -17,6 +17,11 @@
# Check that GDB can support multiple watchpoints across threads.
+# Define this if your target board doesn't support threads.
+if [target_info exists gdb,skip_thread_tests] {
+ return;
+}
+
if $tracelevel {
strace $tracelevel
}