From bf515867780e3e7d38576ef4e6102a1f3a417ded Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Sat, 23 Jun 2018 23:41:51 +0000 Subject: [PATCH] [testsuite/guality] Fix tcl error on missing gdb 2018-06-24 Tom de Vries * 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 | 7 +++++++ gcc/testsuite/g++.dg/guality/guality.exp | 2 +- gcc/testsuite/gcc.dg/guality/guality.exp | 2 +- gcc/testsuite/gfortran.dg/guality/guality.exp | 2 +- gcc/testsuite/lib/gcc-gdb-test.exp | 5 +++++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 01218b3bafd..5ff08f0720e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-06-24 Tom de Vries + + * 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 * g++.dg/concepts/locations1.C: New. diff --git a/gcc/testsuite/g++.dg/guality/guality.exp b/gcc/testsuite/g++.dg/guality/guality.exp index e5eaceedc9a..4be22baa19c 100644 --- a/gcc/testsuite/g++.dg/guality/guality.exp +++ b/gcc/testsuite/g++.dg/guality/guality.exp @@ -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\" diff --git a/gcc/testsuite/gcc.dg/guality/guality.exp b/gcc/testsuite/gcc.dg/guality/guality.exp index 2a90ec3c8c8..04e889caa2f 100644 --- a/gcc/testsuite/gcc.dg/guality/guality.exp +++ b/gcc/testsuite/gcc.dg/guality/guality.exp @@ -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\" diff --git a/gcc/testsuite/gfortran.dg/guality/guality.exp b/gcc/testsuite/gfortran.dg/guality/guality.exp index 3784cac1ef3..f76347dd52f 100644 --- a/gcc/testsuite/gfortran.dg/guality/guality.exp +++ b/gcc/testsuite/gfortran.dg/guality/guality.exp @@ -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} ]] "" "" diff --git a/gcc/testsuite/lib/gcc-gdb-test.exp b/gcc/testsuite/lib/gcc-gdb-test.exp index f3726635c03..9aff6218300 100644 --- a/gcc/testsuite/lib/gcc-gdb-test.exp +++ b/gcc/testsuite/lib/gcc-gdb-test.exp @@ -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" -- 2.30.2