-# 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
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 .*" \
}
}
+# 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"