@@ -3537,7 +3537,7 @@ proc gdb_download { filename } {
global cleanfiles
set destname [remote_download target $filename]
- lappend cleanfiles $destname
+ lappend cleanfiles(target) $destname
return $destname
}
@@ -3595,7 +3595,7 @@ proc default_gdb_init { test_file_name } {
global cleanfiles
global pf_prefix
- set cleanfiles {}
+ array unset cleanfiles
gdb_clear_suppressed
@@ -3862,10 +3862,15 @@ proc gdb_finish { } {
# Exit first, so that the files are no longer in use.
gdb_exit
- if { [llength $cleanfiles] > 0 } {
- eval remote_file target delete $cleanfiles
- set cleanfiles {}
+ # CLEANFILES is an array, in which the key is host name, such as
+ # 'target' or 'host' etc, and the value is a list of files copied
+ # to the machine represented by the key.
+ foreach dest [array names cleanfiles] {
+ foreach filename $cleanfiles($dest) {
+ eval remote_file $dest delete $filename
+ }
}
+ array unset cleanfiles
# Unblock write access to the banned variables. Dejagnu typically
# resets some of them between testcases.