-# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2008,
-# 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 1996-2015 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
# This file was written by Fred Fish. (fnf@cygnus.com)
-if $tracelevel then {
- strace $tracelevel
-}
-
-
-# This only works with native configurations
-if ![isnative] then {
- return
-}
-set testfile "pthreads"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
# regexp for "horizontal" text (i.e. doesn't include newline or
# carriage return)
set target_cflags ""
}
-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug] != "" } {
return -1
}
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
gdb_test_no_output "set print sevenbit-strings"
#gdb_test_no_output "set print address off"
# We'll need this when we send_gdb a ^C to GDB. Need to do it before we
# run the program and gdb starts saving and restoring tty states.
-# On Ultrix, we don't need it and it is really slow (because shell_escape
-# doesn't use vfork).
-if ![istarget "*-*-ultrix*"] then {
- gdb_test "shell stty intr '^C'" ".*"
-}
+gdb_test "shell stty intr '^C'" ".*"
proc all_threads_running {} {
global gdb_prompt
}
if { $return_me == 1 } then {
- return 0;
+ return 0
}
# Check that we stopped when we actually expected to stop, by
}
if { $return_me == 1 } then {
- return 0;
+ return 0
}
# Extract the thread id number of main thread from "info threads" output.
}
timeout {
fail "$description (timeout)"
- return 1;
+ return 1
}
}
gdb_test "bt" ".*"
if [all_threads_running] then {
pass "All threads running after continuing from ^C stop"
}
- return 0;
+ return 0
}
proc check_backtraces {} {
"set break at common_routine in thread 2"
gdb_test_multiple "continue" "continue to bkpt at common_routine in thread 2" {
- -re "Breakpoint .* common_routine \\(arg=2\\).*" {
+ -re "Breakpoint .* common_routine \\(arg=2\\).*$gdb_prompt $" {
pass "continue to bkpt at common_routine in thread 2"
gdb_test "backtrace" \
"#0.*common_routine \\(arg=2\\).*#1.*thread2.*" \
"backtrace from thread 2 bkpt in common_routine"
}
- -re "Breakpoint .* common_routine \\(arg=0\\).*" {
+ -re "Breakpoint .* common_routine \\(arg=0\\).*$gdb_prompt $" {
fail "continue to bkpt at common_routine in thread 2 (arg=0)"
}
- -re "Breakpoint .* common_routine \\(arg=1\\).*" {
+ -re "Breakpoint .* common_routine \\(arg=1\\).*$gdb_prompt $" {
fail "continue to bkpt at common_routine in thread 2 (arg=1)"
}
}
}
-setup_xfail "alpha-*-osf*"
if [runto_main] then {
- clear_xfail "alpha-*-osf*"
if [test_startup] then {
if [check_control_c] then {
warning "Could not stop child with ^C; skipping rest of tests.\n"
- return;
+ return
}
check_backtraces
}
}
-clear_xfail "alpha-*-osf*"