Fix PR gdb/844
authorDaniel Jacobowitz <drow@false.org>
Sat, 4 Jan 2003 23:05:05 +0000 (23:05 +0000)
committerDaniel Jacobowitz <drow@false.org>
Sat, 4 Jan 2003 23:05:05 +0000 (23:05 +0000)
* 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.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/gcore-thread.exp
gdb/testsuite/gdb.threads/killed.exp
gdb/testsuite/gdb.threads/linux-dp.exp
gdb/testsuite/gdb.threads/print-threads.exp
gdb/testsuite/gdb.threads/pthreads.exp
gdb/testsuite/gdb.threads/schedlock.exp
gdb/testsuite/lib/gdb.exp

index 6602520393504c48d8cd591aa8acd4d035b370e3..6c39246bc9aa5451064d4da0ab05cadcbdd913e8 100644 (file)
@@ -1,3 +1,19 @@
+2003-01-04  Daniel Jacobowitz  <drow@mvista.com>
+
+       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.
+
 2003-01-04  Daniel Jacobowitz  <drow@mvista.com>
 
        * gdb.base/callfuncs.exp: Don't XFAIL unprototyped functions for
index 6ec14ef38fa0b17ae3ea75e58020edc6bfe5e811..8184fa52d0bcd052b1002a8e1de23120d17fb258 100644 (file)
@@ -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
 }
 
index 8037dd492b5253c81ae56187fa5fa9420dd5810a..5557d453a8bcf6c711c43c88815d974eea771990 100644 (file)
@@ -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
 }
 
 
index 67ed122d10382544a72b249e55a874e3e3bee07c..6d48b0dd1417947583e3ba7fd13ab0a117562c21 100644 (file)
@@ -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
index 7bbc5aaaf6eac9b07907a1d395903552316912cf..60a106a050bc50be6a1039c796fa9c7dc0c67715 100644 (file)
@@ -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
 }
 
index c37e306ca5b6d491658abab2020a1595b7a80a16..1ab019bbea64b89440f6e47fed594c5e206c9a85 100644 (file)
@@ -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
 }
 
 
index 2f0be4bc3451ba40f7be39a08dd5f94ad5b98b1c..28298c684a93bdfc800287c6abbc61524c103c42 100644 (file)
@@ -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
 }
 
index a3392219bb8775e8f1a248735f79f2bec36b88ef..b4261ae31a354f48527480cf64257e903162eded 100644 (file)
@@ -1,4 +1,5 @@
-# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+# 2002, 2003
 # Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -1134,7 +1135,7 @@ proc gdb_compile {source dest type options} {
     set result [target_compile $source $dest $type $options];
     regsub "\[\r\n\]*$" "$result" "" result;
     regsub "^\[\r\n\]*" "$result" "" result;
-    if { $result != "" } {
+    if { $result != "" && [lsearch $options quiet] == -1} {
        clone_output "gdb compile failed, $result"
     }
     return $result;
@@ -1150,7 +1151,7 @@ proc gdb_compile_pthreads {source dest type options} {
     foreach lib {-lpthreads -lpthread -lthread} {
         # This kind of wipes out whatever libs the caller may have
         # set.  Or maybe theirs will override ours.  How infelicitous.
-        set options_with_lib [concat $options [list libs=$lib]]
+        set options_with_lib [concat $options [list libs=$lib quiet]]
         set ccout [gdb_compile $source $dest $type $options_with_lib]
         switch -regexp -- $ccout {
             ".*no posix threads support.*" {
This page took 0.043639 seconds and 4 git commands to generate.