Fix gdb.multi/multi-kill.exp
authorPedro Alves <palves@redhat.com>
Fri, 15 May 2020 10:22:47 +0000 (11:22 +0100)
committerPedro Alves <palves@redhat.com>
Fri, 15 May 2020 10:22:47 +0000 (11:22 +0100)
The previous patch misssed declaring the 'testpid' array as namespace
variable.  While it at, might as well go back to having start_inferior
refer to the "global" testpid, using "variable" too.

gdb/testsuite/ChangeLog:
2020-05-15  Pedro Alves  <palves@redhat.com>

* gdb.multi/multi-kill.exp (start_inferior): Remove
'testpid' parameter.  Refer to namespace variable directly.
(testpid): Declare as namespace variable.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.multi/multi-kill.exp

index 93ad65b32a297bd88903183c9aa9654eaefce9d2..b35d10e01bdac55253d8a1e1541ba95eb76ad5c5 100644 (file)
@@ -1,3 +1,9 @@
+2020-05-15  Pedro Alves  <palves@redhat.com>
+
+       * gdb.multi/multi-kill.exp (start_inferior): Remove
+       'testpid' parameter.  Refer to namespace variable directly.
+       (testpid): Declare as namespace variable.
+
 2020-05-15  Pedro Alves  <palves@redhat.com>
 
        * gdb.multi/multi-kill.exp: Wrap in namespace.
index 03bf8449cf87694c0153e2bbb2ff476cccb1e342..b4853a1ea406adaa10430220a06b7f850d53831f 100644 (file)
@@ -44,9 +44,9 @@ namespace eval $testfile {
 
 # Start inferior NUM and record its PID in the TESTPID array.
 
-proc start_inferior {num testpid} {
+proc start_inferior {num} {
     with_test_prefix "start_inferior $num" {
-       upvar $testpid tpid
+       variable testpid
        global binfile srcfile
 
        if {$num != 1} {
@@ -62,8 +62,8 @@ proc start_inferior {num testpid} {
        gdb_run_cmd
        gdb_test "" ".*reakpoint .*, initialized .*${srcfile}.*" "run"
 
-       set tpid($num) [get_integer_valueof "pid" -1]
-       if {$tpid($num) == -1} {
+       set testpid($num) [get_integer_valueof "pid" -1]
+       if {$testpid($num) == -1} {
            return -1
        }
 
@@ -76,10 +76,11 @@ proc start_inferior {num testpid} {
 set NUM_INFS 10
 
 # The array holding each inferior's PID, indexed by inferior number.
+variable testpid
 array set testpid {}
 
 for {set i 1} {$i <= $NUM_INFS} {incr i} {
-    if {[start_inferior $i testpid] < 0} {
+    if {[start_inferior $i] < 0} {
        return -1
     }
 }
This page took 0.031812 seconds and 4 git commands to generate.