Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: FYI: fixlet for linux-dp.exp
Date: Wed, 25 Apr 2012 14:39:00 -0000	[thread overview]
Message-ID: <8762cndijg.fsf@fleche.redhat.com> (raw)

I'm checking this in.

While running the test suite I got:

ERROR: tcl error sourcing ../../../archer/gdb/testsuite/gdb.threads/linux-dp.exp.
ERROR: can't array set "seen": variable isn't array
    while executing
"array set seen {}"
    (file "../../../archer/gdb/testsuite/gdb.threads/linux-dp.exp" line 342)
    invoked from within
"source ../../../archer/gdb/testsuite/gdb.threads/linux-dp.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source ../../../archer/gdb/testsuite/gdb.threads/linux-dp.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name""


This fixes the problem by unsetting 'seen' before the 'array set'.
There's no reason to do things in the current order, the unset removes
the "array-ness".

It would be nice if dejagnu made a new interpreter for each .exp file,
so that variable name clashes couldn't happen...

Tom

2012-04-25  Tom Tromey  <tromey@redhat.com>

	* gdb.threads/linux-dp.exp: Unset 'seen' before 'array set'.

Index: gdb.threads/linux-dp.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/linux-dp.exp,v
retrieving revision 1.30
diff -u -r1.30 linux-dp.exp
--- gdb.threads/linux-dp.exp	16 Jan 2012 16:21:53 -0000	1.30
+++ gdb.threads/linux-dp.exp	25 Apr 2012 13:50:51 -0000
@@ -339,8 +339,8 @@
 }
 
 set any_interesting 0
+catch {unset seen}
 array set seen {}
-unset seen
 for {set i 1} {$i <= $nthreads} {incr i} {
     if [check_philosopher_stack $i seen] {
 	set any_interesting 1


             reply	other threads:[~2012-04-25 13:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25 14:39 Tom Tromey [this message]
2012-04-26 14:04 ` Pedro Alves
2012-04-26 14:34   ` Joel Brobecker
2012-04-26 14:43   ` Tom Tromey

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=8762cndijg.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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