]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.threads/thread-find.exp
Update years in copyright notice for the GDB files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.threads / thread-find.exp
index 1d8d3162e4be2869992fd4812b1b70a2d937d41f..ba59e1c44aab6af31d48fdb1b9264920054e2df9 100644 (file)
@@ -1,5 +1,4 @@
-# Copyright 2011
-# Free Software Foundation, Inc.
+# Copyright 2011-2013 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
 # Please email any bugs, comments, and/or additions to this file to:
 # bug-gdb@gnu.org
 
-if $tracelevel then {
-       strace $tracelevel
-}
-
-set testfile "linux-dp"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile linux-dp.c
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != ""} {
     return -1
 }
 
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 gdb_test_no_output "set print sevenbit-strings"
 runto_main
 
@@ -38,6 +29,10 @@ runto_main
 gdb_breakpoint [gdb_get_line_number "linuxthreads.exp: info threads 2"]
 gdb_continue_to_breakpoint "main thread's sleep"
 
+# Make sure thread list is up-to-date (in case remote targets have not yet
+# reported thread creation events)
+gdb_test "info threads"
+
 # Create thread names.
 gdb_test "thread apply 1 thread name threadname_1" \
     "Thread 1 .*" \
@@ -428,3 +423,12 @@ gdb_test_multiple "info threads 3-3" "info threads 3-3" {
     }
 }
 
+# Test bad input
+
+gdb_test "info thread foo" \
+    "Args must be numbers or '.' variables." \
+    "info thread foo"
+
+gdb_test "info thread foo -1" \
+    "Args must be numbers or '.' variables." \
+    "info thread foo -1"