public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/testsuite: Use 'array unset' instead of just 'unset'
@ 2020-08-04 11:39 Andrew Burgess
  2020-08-04 12:48 ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Burgess @ 2020-08-04 11:39 UTC (permalink / raw)
  To: gdb-patches

In the check-test-names.exp library 'unset' was being used to unset an
array variable.  Though this seems to work fine on tcl 8.6, it was
discovered on a CentOS 7.8.2003 machine, running tcl 8.5, that this
doesn't work and 'array unset' should be used instead.

Using 'array unset' should work fine for newer and older versions of
tcl (since 8.3, releases ~2000).

gdb/testsuite/ChangeLog:

	* lib/check-test-names.exp (do_reset_vars): Use 'array unset' to
	unset the array variable.
---
 gdb/testsuite/ChangeLog                | 5 +++++
 gdb/testsuite/lib/check-test-names.exp | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/check-test-names.exp b/gdb/testsuite/lib/check-test-names.exp
index 4c0fde6e4ea..d72de3cf821 100644
--- a/gdb/testsuite/lib/check-test-names.exp
+++ b/gdb/testsuite/lib/check-test-names.exp
@@ -150,7 +150,7 @@ namespace eval ::CheckTestNames {
 
 	CheckTestNames::reset_vars
 
-	unset all_test_names
+	array unset all_test_names
 	foreach nm {paths duplicates} {
 	    set counts($nm,count) 0
 	}
-- 
2.25.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gdb/testsuite: Use 'array unset' instead of just 'unset'
  2020-08-04 11:39 [PATCH] gdb/testsuite: Use 'array unset' instead of just 'unset' Andrew Burgess
@ 2020-08-04 12:48 ` Simon Marchi
  2020-08-04 14:56   ` Andrew Burgess
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2020-08-04 12:48 UTC (permalink / raw)
  To: Andrew Burgess, gdb-patches

On 2020-08-04 7:39 a.m., Andrew Burgess wrote:
> In the check-test-names.exp library 'unset' was being used to unset an
> array variable.  Though this seems to work fine on tcl 8.6, it was
> discovered on a CentOS 7.8.2003 machine, running tcl 8.5, that this
> doesn't work and 'array unset' should be used instead.
> 
> Using 'array unset' should work fine for newer and older versions of
> tcl (since 8.3, releases ~2000).
> 
> gdb/testsuite/ChangeLog:
> 
> 	* lib/check-test-names.exp (do_reset_vars): Use 'array unset' to
> 	unset the array variable.
> ---
>  gdb/testsuite/ChangeLog                | 5 +++++
>  gdb/testsuite/lib/check-test-names.exp | 2 +-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/lib/check-test-names.exp b/gdb/testsuite/lib/check-test-names.exp
> index 4c0fde6e4ea..d72de3cf821 100644
> --- a/gdb/testsuite/lib/check-test-names.exp
> +++ b/gdb/testsuite/lib/check-test-names.exp
> @@ -150,7 +150,7 @@ namespace eval ::CheckTestNames {
>  
>  	CheckTestNames::reset_vars
>  
> -	unset all_test_names
> +	array unset all_test_names
>  	foreach nm {paths duplicates} {
>  	    set counts($nm,count) 0
>  	}
> -- 
> 2.25.4
> 

Thanks, that makes it work.

For context (for others), I stumbled on this issue on machine gcc135 of the compile
farm, where running any test would give:

can't unset "all_test_names": no such variable
    while executing
"unset all_test_names"
    (procedure "CheckTestNames::do_reset_vars" line 7)
    invoked from within
"CheckTestNames::do_reset_vars"
    ("eval" body line 1)
    invoked from within
"eval "CheckTestNames::do_reset_vars""
    (procedure "reset_vars" line 2)
    invoked from within
"reset_vars"
    (procedure "runtest" line 10)
    invoked from within
"runtest $test_name"
    ("foreach" body line 42)
    invoked from within

Simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gdb/testsuite: Use 'array unset' instead of just 'unset'
  2020-08-04 12:48 ` Simon Marchi
@ 2020-08-04 14:56   ` Andrew Burgess
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Burgess @ 2020-08-04 14:56 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

* Simon Marchi <simon.marchi@polymtl.ca> [2020-08-04 08:48:27 -0400]:

> On 2020-08-04 7:39 a.m., Andrew Burgess wrote:
> > In the check-test-names.exp library 'unset' was being used to unset an
> > array variable.  Though this seems to work fine on tcl 8.6, it was
> > discovered on a CentOS 7.8.2003 machine, running tcl 8.5, that this
> > doesn't work and 'array unset' should be used instead.
> > 
> > Using 'array unset' should work fine for newer and older versions of
> > tcl (since 8.3, releases ~2000).
> > 
> > gdb/testsuite/ChangeLog:
> > 
> > 	* lib/check-test-names.exp (do_reset_vars): Use 'array unset' to
> > 	unset the array variable.
> > ---
> >  gdb/testsuite/ChangeLog                | 5 +++++
> >  gdb/testsuite/lib/check-test-names.exp | 2 +-
> >  2 files changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/gdb/testsuite/lib/check-test-names.exp b/gdb/testsuite/lib/check-test-names.exp
> > index 4c0fde6e4ea..d72de3cf821 100644
> > --- a/gdb/testsuite/lib/check-test-names.exp
> > +++ b/gdb/testsuite/lib/check-test-names.exp
> > @@ -150,7 +150,7 @@ namespace eval ::CheckTestNames {
> >  
> >  	CheckTestNames::reset_vars
> >  
> > -	unset all_test_names
> > +	array unset all_test_names
> >  	foreach nm {paths duplicates} {
> >  	    set counts($nm,count) 0
> >  	}
> > -- 
> > 2.25.4
> > 
> 
> Thanks, that makes it work.

Excellent.  I've pushed this.

Thanks,
Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-04 14:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-04 11:39 [PATCH] gdb/testsuite: Use 'array unset' instead of just 'unset' Andrew Burgess
2020-08-04 12:48 ` Simon Marchi
2020-08-04 14:56   ` Andrew Burgess

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).