Fix PR gdb/844
* lib/gdb.exp (gdb_compile): Handle "quiet" option. (gdb_compile_pthreads): Pass "quiet" to gdb_compile. * gdb.threads/gcore-thread.exp: Use gdb_compile_pthreads. Return instead of calling gdb_suppress_entire_file. * gdb.threads/print-threads.exp: Likewise. * gdb.threads/schedlock.exp: Likewise. * gdb.threads/killed.exp: Return instead of calling gdb_suppress_entire_file. * gdb.threads/linux-dp.exp: Likewise. * gdb.threads/pthreads.exp: Likewise.
This commit is contained in:
parent
ff2d781336
commit
b5ab8ff3a4
8 changed files with 29 additions and 105 deletions
|
@ -1,4 +1,4 @@
|
|||
# Copyright 2002 Free Software Foundation, Inc.
|
||||
# Copyright 2002, 2003 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
|
||||
|
@ -32,38 +32,13 @@ set testfile "pthreads"
|
|||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
set built_binfile 0
|
||||
if [istarget "*-*-linux"] then {
|
||||
set target_cflags "-D_MIT_POSIX_THREADS"
|
||||
} else {
|
||||
set target_cflags ""
|
||||
}
|
||||
set why_msg "unrecognized error"
|
||||
foreach lib {-lpthreads -lpthread -lthread} {
|
||||
set options "debug"
|
||||
lappend options "incdir=${objdir}"
|
||||
lappend options "libs=$lib"
|
||||
set ccout [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options]
|
||||
switch -regexp -- $ccout {
|
||||
".*no posix threads support.*" {
|
||||
set why_msg "missing threads include file"
|
||||
break
|
||||
}
|
||||
".*cannot open -lpthread.*" {
|
||||
set why_msg "missing runtime threads library"
|
||||
}
|
||||
".*Can't find library for -lpthread.*" {
|
||||
set why_msg "missing runtime threads library"
|
||||
}
|
||||
{^$} {
|
||||
pass "successfully compiled posix threads test case"
|
||||
set built_binfile 1
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if {$built_binfile == "0"} {
|
||||
unsupported "Couldn't compile ${srcfile}, ${why_msg}"
|
||||
|
||||
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
|
||||
return -1
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ set srcfile ${testfile}.c
|
|||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
return -1
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright 1999, 2001, 2002 Free Software Foundation, Inc.
|
||||
# Copyright 1999, 2001, 2002, 2003 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
|
||||
|
@ -50,7 +50,7 @@ set testfile "linux-dp"
|
|||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug libs=-lpthread}] != ""} {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
return -1
|
||||
}
|
||||
|
||||
gdb_start
|
||||
|
|
|
@ -38,41 +38,7 @@ set binfile ${objdir}/${subdir}/${testfile}
|
|||
# carriage return)
|
||||
set horiz "\[^\n\r\]*"
|
||||
|
||||
set built_binfile 0
|
||||
|
||||
# Default to the usual (only?) -lpthread on GNU/Linux to quiet noise
|
||||
if [istarget "*-*-linux*"] then {
|
||||
set possible_libs "-lpthread -lpthreads -lthread"
|
||||
} else {
|
||||
set possible_libs "-lpthreads -lpthread -lthread"
|
||||
}
|
||||
|
||||
set why_msg "unrecognized error"
|
||||
foreach lib $possible_libs {
|
||||
set options "debug"
|
||||
lappend options "incdir=${objdir}"
|
||||
lappend options "libs=$lib"
|
||||
set ccout [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options]
|
||||
switch -regexp -- $ccout {
|
||||
".*no posix threads support.*" {
|
||||
set why_msg "missing threads include file"
|
||||
break
|
||||
}
|
||||
".*cannot open -lpthread.*" {
|
||||
set why_msg "missing runtime threads library"
|
||||
}
|
||||
".*Can't find library for -lpthread.*" {
|
||||
set why_msg "missing runtime threads library"
|
||||
}
|
||||
{^$} {
|
||||
pass "successfully compiled posix threads test case"
|
||||
set built_binfile 1
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if {$built_binfile == "0"} {
|
||||
unsupported "Couldn't compile ${srcfile}, ${why_msg}"
|
||||
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
|
||||
return -1
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ if [istarget "*-*-linux"] then {
|
|||
}
|
||||
|
||||
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
return -1
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -33,41 +33,7 @@ set testfile "schedlock"
|
|||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
set built_binfile 0
|
||||
|
||||
# Default to the usual (only?) -lpthread on GNU/Linux to quiet noise
|
||||
if [istarget "*-*-linux*"] then {
|
||||
set possible_libs "-lpthread -lpthreads -lthread"
|
||||
} else {
|
||||
set possible_libs "-lpthreads -lpthread -lthread"
|
||||
}
|
||||
|
||||
set why_msg "unrecognized error"
|
||||
foreach lib $possible_libs {
|
||||
set options "debug"
|
||||
lappend options "incdir=${objdir}"
|
||||
lappend options "libs=$lib"
|
||||
set ccout [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options]
|
||||
switch -regexp -- $ccout {
|
||||
".*no posix threads support.*" {
|
||||
set why_msg "missing threads include file"
|
||||
break
|
||||
}
|
||||
".*cannot open -lpthread.*" {
|
||||
set why_msg "missing runtime threads library"
|
||||
}
|
||||
".*Can't find library for -lpthread.*" {
|
||||
set why_msg "missing runtime threads library"
|
||||
}
|
||||
{^$} {
|
||||
pass "successfully compiled posix threads test case"
|
||||
set built_binfile 1
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if {$built_binfile == "0"} {
|
||||
unsupported "Couldn't compile ${srcfile}, ${why_msg}"
|
||||
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
|
||||
return -1
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue