aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/testenv.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/testenv.exp')
-rw-r--r--gdb/testsuite/gdb.base/testenv.exp24
1 files changed, 13 insertions, 11 deletions
diff --git a/gdb/testsuite/gdb.base/testenv.exp b/gdb/testsuite/gdb.base/testenv.exp
index beb59d2..540a48f 100644
--- a/gdb/testsuite/gdb.base/testenv.exp
+++ b/gdb/testsuite/gdb.base/testenv.exp
@@ -27,7 +27,7 @@ standard_testfile .c
# Compile binary
# and start with a fresh gdb
-if { [prepare_for_testing "failed to prepare" ${binfile} ${srcfile}] } {
+if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
return -1
}
@@ -75,7 +75,7 @@ proc find_env {varname} {
}
if {[string match "$varname=*" $var]} {
- set from [expr [string first "=" $var] + 1]
+ set from [expr {[string first "=" $var] + 1}]
set to [string length $var]
return [string range $var $from $to]
}
@@ -90,11 +90,12 @@ proc find_env {varname} {
proc_with_prefix test_set_unset_env {} {
global binfile
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
# First test with no TEST_GDB_VAR.
with_test_prefix "test1" {
- if ![run_and_count_vars] {
+ if {![run_and_count_vars]} {
return
}
test_num_test_vars 0 "no TEST_GDB vars"
@@ -105,7 +106,7 @@ proc_with_prefix test_set_unset_env {} {
gdb_test_no_output "set env TEST_GDB_VAR1 test1" \
"set TEST_GDB_VAR1"
- if ![run_and_count_vars] {
+ if {![run_and_count_vars]} {
return
}
test_num_test_vars 1 "one TEST_GDB var"
@@ -116,7 +117,7 @@ proc_with_prefix test_set_unset_env {} {
gdb_test_no_output "set env TEST_GDB_VAR2 test2" \
"set TEST_GDB_VAR2"
- if ![run_and_count_vars] {
+ if {![run_and_count_vars]} {
return
}
@@ -129,7 +130,7 @@ proc_with_prefix test_set_unset_env {} {
gdb_test_no_output "unset env TEST_GDB_VAR1" \
"unset TEST_GDB_VAR1"
- if ![run_and_count_vars] {
+ if {![run_and_count_vars]} {
return
}
@@ -144,20 +145,21 @@ proc_with_prefix test_inherit_env_var {} {
# This test assumes that the build's environ (where dejagnu runs)
# is the same as the host's (where gdb runs) environ.
- if [is_remote host] {
+ if {[is_remote host]} {
return
}
save_vars {env(TEST_GDB_GLOBAL)} {
set env(TEST_GDB_GLOBAL) "Global environment value"
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_breakpoint $bp_line
# First test with only inherited TEST_GDB_GLOBAL.
with_test_prefix "test1" {
- if ![run_and_count_vars] {
+ if {![run_and_count_vars]} {
return
}
@@ -177,7 +179,7 @@ proc_with_prefix test_inherit_env_var {} {
gdb_test_no_output "unset env TEST_GDB_GLOBAL" \
"unset TEST_GDB_GLOBAL"
- if ![run_and_count_vars] {
+ if {![run_and_count_vars]} {
return
}