aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2020-05-15 11:22:47 +0100
committerPedro Alves <palves@redhat.com>2020-05-15 11:22:47 +0100
commit3c5c3649729ba3f94f9d28f10aa2270c8c7e4aa9 (patch)
tree724c501d4ff84e8a06c89425bf505d6ce3e88693
parent272c36b87f81fd64e5f4669730da72c39d0716b3 (diff)
downloadfsf-binutils-gdb-3c5c3649729ba3f94f9d28f10aa2270c8c7e4aa9.zip
fsf-binutils-gdb-3c5c3649729ba3f94f9d28f10aa2270c8c7e4aa9.tar.gz
fsf-binutils-gdb-3c5c3649729ba3f94f9d28f10aa2270c8c7e4aa9.tar.bz2
Fix gdb.multi/multi-kill.exp
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.
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.multi/multi-kill.exp11
2 files changed, 12 insertions, 5 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 93ad65b3..b35d10e 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
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.
(start_inferior): Add TESTPID parameter. Use it instead of the
testpid global.
diff --git a/gdb/testsuite/gdb.multi/multi-kill.exp b/gdb/testsuite/gdb.multi/multi-kill.exp
index 03bf844..b4853a1 100644
--- a/gdb/testsuite/gdb.multi/multi-kill.exp
+++ b/gdb/testsuite/gdb.multi/multi-kill.exp
@@ -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
}
}