public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Christophe Lyon <christophe.lyon@linaro.org>, Jeff Law <law@redhat.com>
Cc: gcc Patches <gcc-patches@gcc.gnu.org>,
	Mike Stump <mikestump@comcast.net>,
	Rainer Orth <ro@cebitec.uni-bielefeld.de>
Subject: Re: [PATCH][testsuite/guality] Be verbose about gdb version used
Date: Sat, 23 Jun 2018 23:47:00 -0000	[thread overview]
Message-ID: <b29e6fc4-f156-3913-7564-e77f24b3151a@suse.de> (raw)
In-Reply-To: <CAKdteOaL4igUsXtqZ2F+xQjjLLjLVg23-ADTks2SP+jnfh6UCw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1679 bytes --]

On 06/23/2018 07:05 PM, Christophe Lyon wrote:
> Hello,
> 
> On Fri, 22 Jun 2018 at 18:01, Jeff Law <law@redhat.com> wrote:
>>
>> On 06/22/2018 05:35 AM, Tom de Vries wrote:
>>> Hi,
>>>
>>> by default, guality invokes gdb with --quiet to avoid being unnecessarily
>>> verbose for each test.  But as a consequence, we don't see which version of
>>> gdb is used.
>>>
>>> This patch adds printing of the full path to the gdb used, as well as the
>>> gdb version as printed by gdb.
>>>
>>> Tested on x86_64.
>>>
>>> OK for trunk?
>>>
>>> Thanks,
>>> - Tom
>>>
>>> [testsuite/guality] Be verbose about gdb version used
>>>
>>> 2018-06-22  Tom de Vries  <tdevries@suse.de>
>>>
>>>       * lib/gcc-gdb-test.exp (report_gdb): New proc.
>>>       * g++.dg/guality/guality.exp: Use report_gdb.
>>>       * gcc.dg/guality/guality.exp: Same.
>>>       * gfortran.dg/guality/guality.exp: Same.
>> OK.
> 
> It looks like this patch is causing problems when not building gdb. I
> my GCC testing, I'm now seeing:
> ERROR: tcl error sourcing /gcc/testsuite/gfortran.dg/guality/guality.exp.
> ERROR: which: no aarch64-none-linux-gnu-gdb in
> (/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/bin:/work/local/bin:/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-aarch64-none-linux-gnu/gcc3/utils/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin)
>     while executing
> "exec which $::env(GUALITY_GDB_NAME)"
>     invoked from within
> "report_gdb [exec which $::env(GUALITY_GDB_NAME)] [info script]"
> 

Hi,

the problem is not related to building or not building gdb, it's related
to whether the gdb that guality.exp is trying to use, is available in
PATH or not.

I've fixed this in attached patch.

Thanks,
- Tom

[-- Attachment #2: 0001-testsuite-guality-Fix-tcl-error-on-missing-gdb.patch --]
[-- Type: text/x-patch, Size: 2830 bytes --]

[testsuite/guality] Fix tcl error on missing gdb

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.

---
 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 +++++
 4 files changed, 8 insertions(+), 3 deletions(-)

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"

  reply	other threads:[~2018-06-23 23:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-22 11:35 Tom de Vries
2018-06-22 16:01 ` Jeff Law
2018-06-23 17:06   ` Christophe Lyon
2018-06-23 23:47     ` Tom de Vries [this message]
2018-06-25 12:32       ` Andreas Schwab
2018-06-25 13:18         ` Tom de Vries
2018-06-25 14:36           ` Andreas Schwab
2018-06-25 16:02             ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b29e6fc4-f156-3913-7564-e77f24b3151a@suse.de \
    --to=tdevries@suse.de \
    --cc=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=mikestump@comcast.net \
    --cc=ro@cebitec.uni-bielefeld.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).