+2012-07-10 Tom Tromey <tromey@redhat.com>
+
+ * lib/gdb.exp (standard_testfile): Unset output variables from
+ earlier invocations.
+
2012-07-10 Yao Qi <yao@codesourcery.com>
* gdb.mi/gdb2549.exp: Remove -DFAKEARGV from compilation flags.
proc standard_testfile {args} {
global gdb_test_file_name
global objdir subdir
+ global gdb_test_file_last_vars
# Outputs.
global testfile binfile
set args .c
}
+ # Unset our previous output variables.
+ # This can help catch hidden bugs.
+ if {[info exists gdb_test_file_last_vars]} {
+ foreach varname $gdb_test_file_last_vars {
+ global $varname
+ catch {unset $varname}
+ }
+ }
+ # 'executable' is often set by tests.
+ set gdb_test_file_last_vars {executable}
+
set suffix ""
foreach arg $args {
set varname srcfile$suffix
}
set $varname $arg
+ lappend gdb_test_file_last_vars $varname
if {$suffix == ""} {
set suffix 2