[testsuite/guality] Fix tcl error on missing gdb
authorTom de Vries <tdevries@suse.de>
Sat, 23 Jun 2018 23:41:51 +0000 (23:41 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Sat, 23 Jun 2018 23:41:51 +0000 (23:41 +0000)
2018-06-24  Tom de Vries  <tdevries@suse.de>

* g++.dg/guality/guality.exp: Don't use which on gdb arg to report_gdb.
* gcc.dg/guality/guality.exp: Same.
* gfortran.dg/guality/guality.exp: Same.
* lib/gcc-gdb-test.exp: Do early out if which gdb fails.

From-SVN: r261988

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/guality/guality.exp
gcc/testsuite/gcc.dg/guality/guality.exp
gcc/testsuite/gfortran.dg/guality/guality.exp
gcc/testsuite/lib/gcc-gdb-test.exp

index 01218b3bafd2ea3f017e2c16d6e9b5bba90e925c..5ff08f0720ee0021172e16c29ee582fc4d840497 100644 (file)
@@ -1,3 +1,10 @@
+2018-06-24  Tom de Vries  <tdevries@suse.de>
+
+       * g++.dg/guality/guality.exp: Don't use which on gdb arg to report_gdb.
+       * gcc.dg/guality/guality.exp: Same.
+       * gfortran.dg/guality/guality.exp: Same.
+       * lib/gcc-gdb-test.exp: Do early out if which gdb fails.
+
 2018-06-23  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * g++.dg/concepts/locations1.C: New.
index e5eaceedc9ab529eace3209973a6220fec8f49a2..4be22baa19c0f225547677e0ac67ca35d6fb7f18 100644 (file)
@@ -46,7 +46,7 @@ if ![info exists ::env(GUALITY_GDB_NAME)] {
     }
     setenv GUALITY_GDB_NAME "$guality_gdb_name"
 }
-report_gdb [exec which $::env(GUALITY_GDB_NAME)] [info script]
+report_gdb $::env(GUALITY_GDB_NAME) [info script]
 
 if {[check_guality "
   #include \"$srcdir/$subdir/guality.h\"
index 2a90ec3c8c8e3a3a49241f69f49726ec8729e7d1..04e889caa2f8e2167ca0ec68d20b351064478d17 100644 (file)
@@ -46,7 +46,7 @@ if ![info exists ::env(GUALITY_GDB_NAME)] {
     }
     setenv GUALITY_GDB_NAME "$guality_gdb_name"
 }
-report_gdb [exec which $::env(GUALITY_GDB_NAME)] [info script]
+report_gdb $::env(GUALITY_GDB_NAME) [info script]
 
 if {[check_guality "
   #include \"$srcdir/$subdir/guality.h\"
index 3784cac1ef32e16148819450f84632507731ede3..f76347dd52fc191e49e8bed1a7abd2513f176b3e 100644 (file)
@@ -27,7 +27,7 @@ if ![info exists ::env(GUALITY_GDB_NAME)] {
     }
     setenv GUALITY_GDB_NAME "$guality_gdb_name"
 }
-report_gdb [exec which $::env(GUALITY_GDB_NAME)] [info script]
+report_gdb $::env(GUALITY_GDB_NAME) [info script]
 
 gfortran-dg-runtest [lsort [glob $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ]] "" ""
 
index f3726635c038351b883f95fa351b3218b9e34571..9aff6218300682d203a589f3cffec3ee45191735 100644 (file)
@@ -145,6 +145,11 @@ proc gdb-test { args } {
 # Argument 1 is the location where gdb is used
 # 
 proc report_gdb { gdb loc } {
+    if { [catch { exec which $gdb } msg] } {
+       send_log "gdb not found in $loc: $msg\n"
+       return
+    }
+    set gdb [exec which $gdb]
     send_log "gdb used in $loc: $gdb\n"
     set gdb_version [exec $gdb -v]
     send_log "gdb used in $loc: version:\n---\n$gdb_version\n---\n"