Copyright year update in most files of the GDB Project.
[external/binutils.git] / gdb / testsuite / gdb.base / break-interp.exp
1 # Copyright 2010-2012 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
16 # This test only works on GNU/Linux.
17 if { ![isnative] || [is_remote host] || [target_info exists use_gdb_stub]
18      || ![istarget *-linux*] || [skip_shlib_tests]} {
19     continue
20 }
21
22 load_lib prelink-support.exp
23
24 set test "break-interp"
25 set binprefix ${objdir}/${subdir}/${test}
26 # Only to get the $interp_system name.
27 set srcfile_test "start.c"
28 set binfile_test ${test}-test
29 set binfile_lib ${objdir}/${subdir}/${test}.so
30 set srcfile "${test}-main.c"
31 set srcfile_lib "${test}-lib.c"
32
33 if [get_compiler_info ${binfile_lib}] {
34     return -1
35 }
36
37 # Use -soname so that the new library gets copied by build_executable_own_libs.
38
39 if {[gdb_compile_shlib ${srcdir}/${subdir}/${srcfile_lib} ${binfile_lib} [list debug ldflags=-Wl,-soname,${test}.so]] != ""} {
40     return -1
41 }
42
43 if {[build_executable ${test}.exp $binfile_test ${srcfile_test} {}] == -1} {
44     return -1
45 }
46
47 # Note: The separate debug info file content build-id/crc32 are not verified
48 # contrary to the GDB search algorithm skipping non-matching ones.
49 proc system_debug_get {exec} {
50     global debug_root
51
52     set exec_build_id_debug [build_id_debug_filename_get $exec]
53     set debug_base "[file tail $exec].debug"
54     set exec_dir [file dirname $exec]
55
56     # isfile returns 1 even for symlinks to files.
57     set retval $debug_root/$exec_build_id_debug
58     if [file isfile $retval] {
59         return $retval
60     }
61     set retval $exec_dir/$debug_base
62     if [file isfile $retval] {
63         return $retval
64     }
65     set retval $exec_dir/.debug/$debug_base
66     if [file isfile $retval] {
67         return $retval
68     }
69     set retval $debug_root/$exec_dir/$debug_base
70     if [file isfile $retval] {
71         return $retval
72     }
73     return ""
74 }
75
76 gdb_exit
77 gdb_start
78 set debug_root ""
79 set test "show debug-file-directory"
80 gdb_test_multiple $test $test {
81     -re "The directory where separate debug symbols are searched for is \"(.*)\".\r\n$gdb_prompt $" {
82         set debug_root $expect_out(1,string)
83     }
84 }
85
86 set interp_system [section_get ${objdir}/${subdir}/$binfile_test .interp]
87 set interp_system_debug [system_debug_get $interp_system]
88 verbose -log "$interp_system has debug $interp_system_debug"
89
90 proc prelinkNO {arg {name ""}} {
91     return [prelink_no $arg $name]
92 }
93
94 proc prelinkYES {arg {name ""}} {
95     return [prelink_yes $arg $name]
96 }
97
98 proc strip_debug {dest} {
99     set test "strip [file tail $dest]"
100     set strip_program [transform strip]
101     set command "exec $strip_program --strip-debug $dest"
102     verbose -log "command is $command"
103     if [catch $command] {
104         fail $test
105         return 0
106     } else {
107         pass $test
108         return 1
109     }
110 }
111
112 # Implementation of reach.
113
114 proc reach_1 {func command displacement} {
115     global gdb_prompt expect_out
116
117     if {$func == "_dl_debug_state"} {
118         # Breakpoint on _dl_debug_state can have problems due to its overlap
119         # with the existing internal breakpoint from GDB.
120         gdb_test_no_output "set stop-on-solib-events 1"
121     } elseif {! [gdb_breakpoint $func allow-pending]} {
122         return
123     }
124
125     set test "reach"
126     set test_displacement "seen displacement message as $displacement"
127     set debug_state_count 0
128     gdb_test_multiple $command $test {
129         -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " {
130             # Missing "$gdb_prompt $" is intentional.
131             if {$expect_out(1,string) == "0x0"} {
132                 set case "ZERO"
133             } else {
134                 set case "NONZERO"
135             }
136             if {$displacement == $case || $displacement == "PRESENT"} {
137                 pass $test_displacement
138                 set displacement "FOUND-$displacement"
139             } else {
140                 fail $test_displacement
141             }
142             exp_continue
143         }
144         -re "Breakpoint \[0-9\]+, \\.?(__GI_)?$func \\(.*\\) at .*:\[0-9\]+\r\n.*$gdb_prompt $" {
145             if {$func == "_dl_debug_state"} {
146                 fail $test
147             } else {
148                 pass $test
149             }
150         }
151         -re "Breakpoint \[0-9\]+, \[0-9xa-f\]+ in \\.?(__GI_)?$func \\(\\).*\r\n$gdb_prompt $" {
152             if {$func == "_dl_debug_state"} {
153                 fail $test
154             } else {
155                 pass $test
156             }
157         }
158         -re "Stopped due to shared library event\r\n$gdb_prompt $" {
159             if {$func == "_dl_debug_state"} {
160                 if {$debug_state_count == 0} {
161                     # First stop does not yet relocate the _start function
162                     # descriptor on ppc64.
163                     set debug_state_count 1
164                     send_gdb "continue\n"
165                     exp_continue
166                 } else {
167                     pass $test
168                 }
169             } else {
170                 fail $test
171             }
172         }
173     }
174     if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
175         fail $test_displacement
176     }
177
178     if {$func == "_dl_debug_state"} {
179         gdb_test_no_output "set stop-on-solib-events 0"
180     }
181 }
182
183 # `runto' does not check we stopped really at the function we specified.
184 # DISPLACEMENT can be "NONE" for no message to be present, "ZERO" for
185 # displacement of 0 bytes to be present, "NONZERO" for displacement of non-0
186 # bytes to be present and "PRESENT" if both "ZERO" and "NONZERO" are valid.
187 proc reach {func command displacement} {
188     global pf_prefix
189     set old_ldprefix $pf_prefix
190     lappend pf_prefix "reach-$func:"
191
192     reach_1 $func $command $displacement
193
194     set pf_prefix $old_ldprefix
195 }
196
197 proc test_core {file displacement} {
198     global srcdir subdir gdb_prompt expect_out
199
200     set corefile [core_find $file {} "segv"]
201     if {$corefile == ""} {
202         return
203     }
204
205     global pf_prefix
206     set old_ldprefix $pf_prefix
207     lappend pf_prefix "core:"
208
209     gdb_exit
210     gdb_start
211     # Clear it to never find any separate debug infos in $debug_root.
212     gdb_test_no_output "set debug-file-directory" \
213         "set debug-file-directory for core"
214     gdb_reinitialize_dir $srcdir/$subdir
215     gdb_load $file
216
217     # Print the "PIE (Position Independent Executable) displacement" message.
218     gdb_test_no_output "set verbose on"
219
220     set test "core loaded"
221     set test_displacement "seen displacement message as $displacement"
222     gdb_test_multiple "core-file $corefile" $test {
223         -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " {
224             # Missing "$gdb_prompt $" is intentional.
225             if {$expect_out(1,string) == "0x0"} {
226                 set case "ZERO"
227             } else {
228                 set case "NONZERO"
229             }
230             if {$displacement == $case || $displacement == "PRESENT"} {
231                 pass $test_displacement
232                 set displacement "FOUND-$displacement"
233             } else {
234                 fail $test_displacement
235             }
236             exp_continue
237         }
238         -re "Core was generated by .*\r\n#0 .*$gdb_prompt $" {
239             # Do not check the binary filename as it may be truncated.
240             pass $test
241         }
242     }
243     if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
244         fail $test_displacement
245     }
246
247     gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "core main bt"
248
249     set pf_prefix $old_ldprefix
250 }
251
252 proc test_attach_gdb {file pid displacement prefix} {
253     global gdb_prompt expect_out
254
255     global pf_prefix
256     set old_ldprefix $pf_prefix
257     lappend pf_prefix "$prefix:"
258
259     gdb_exit
260     gdb_start
261
262     # Print the "PIE (Position Independent Executable) displacement" message.
263     gdb_test_no_output "set verbose on"
264
265     if {$file != ""} {
266         gdb_test "file $file" "Reading symbols from .*done\\." "file"
267     }
268
269     set test "attach"
270     gdb_test_multiple "attach $pid" $test {
271         -re "Attaching to (program: .*, )?process $pid\r\n" {
272             # Missing "$gdb_prompt $" is intentional.
273             pass $test
274         }
275     }
276
277     set test "attach final prompt"
278     set test_displacement "seen displacement message as $displacement"
279     gdb_test_multiple "" $test {
280         -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " {
281             # Missing "$gdb_prompt $" is intentional.
282             if {$expect_out(1,string) == "0x0"} {
283                 set case "ZERO"
284             } else {
285                 set case "NONZERO"
286             }
287             if {$displacement == $case || $displacement == "PRESENT"} {
288                 pass $test_displacement
289                 set displacement "FOUND-$displacement"
290             } else {
291                 fail $test_displacement
292             }
293             exp_continue
294         }
295         -re "$gdb_prompt $" {
296             pass $test
297         }
298     }
299     if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
300         fail $test_displacement
301     }
302
303     gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "attach main bt"
304     gdb_exit
305
306     set pf_prefix $old_ldprefix
307 }
308
309 proc test_attach {file displacement {relink_args ""}} {
310     global board_info
311
312     gdb_exit
313
314     set test "sleep function started"
315
316     set command "${file} sleep"
317     set res [remote_spawn host $command];
318     if { $res < 0 || $res == "" } {
319         perror "Spawning $command failed."
320         fail $test
321         return
322     }
323     set pid [exp_pid -i $res]
324     gdb_expect {
325         -re "sleeping\r\n" {
326             pass $test
327         }
328         eof {
329             fail "$test (eof)"
330             return
331         }
332         timeout {
333             fail "$test (timeout)"
334             return
335         }
336     }
337
338     if {$relink_args == ""} {
339         test_attach_gdb "" $pid $displacement "attach"
340     } else {
341         # These could be rather passed as arguments.
342         global exec interp_saved interp
343
344         foreach relink {YES NO} {
345             # Formerly this test was testing only prelinking of $EXEC.  As the
346             # prelink command automatically prelinks all of $EXEC's libraries,
347             # even $INTERP got prelinked.  Therefore, we formerly had to
348             # `[file_copy $interp_saved $interp]' to make $INTERP not affected
349             # by this prelinking of $EXEC.
350             #
351             # But now we need to test even prelinking of $INTERP.  We could
352             # create a separate test to test just the $INTERP prelinking.  For
353             # test simplicity, we merged this test and the test above by not
354             # restoring $INTERP after $EXEC prelink.  $INTERP gets restored
355             # later below.
356             #
357             # `(wrong library or version mismatch?)' messages are printed for
358             # $binfile_lib on platforms converting REL->RELA relocations by
359             # prelink (such as on i386).  There is no reliable way to verify
360             # the library file matches the running library in such case but
361             # GDB at least attempts to set the right displacement.  We test
362             # `libfunc' is present in the backtrace and therefore the
363             # displacement has been guessed right.
364
365             if [prelink$relink $relink_args [file tail $exec]] {
366                 # /proc/PID/exe cannot be loaded as it is "EXECNAME (deleted)".
367                 test_attach_gdb $exec $pid $displacement "attach-relink$relink"
368             }
369         }
370         file_copy $interp_saved $interp
371     }
372
373     remote_exec host "kill -9 $pid"
374 }
375
376 proc test_ld {file ifmain trynosym displacement} {
377     global srcdir subdir gdb_prompt expect_out inferior_exited_re
378
379     # First test normal `file'-command loaded $FILE with symbols.
380
381     gdb_exit
382     gdb_start
383     # Clear it to never find any separate debug infos in $debug_root.
384     gdb_test_no_output "set debug-file-directory"
385     gdb_reinitialize_dir $srcdir/$subdir
386     gdb_load $file
387
388     # Print the "PIE (Position Independent Executable) displacement" message.
389     gdb_test_no_output "set verbose on"
390
391     # We want to test the re-run of a PIE in the case where the executable
392     # is loaded with a different displacement, but disable-randomization
393     # prevents that from happening.  So turn it off.
394     gdb_test "set disable-randomization off"
395
396     if $ifmain {
397         gdb_test_no_output "set args segv"
398     } else {
399         global objdir binfile_test
400
401         # ld.so needs some executable to run to reach _dl_debug_state.
402         gdb_test_no_output "set args ${objdir}/${subdir}/$binfile_test" "set args OBJDIR/${subdir}/$binfile_test"
403     }
404
405     reach "_dl_debug_state" "run" $displacement
406
407     gdb_test "bt" "#0 +\[^\r\n\]*\\m(__GI_)?_dl_debug_state\\M.*" "dl bt"
408
409     if $ifmain {
410         reach "main" continue "NONE"
411
412         reach "libfunc" continue "NONE"
413
414         gdb_test "bt" "#0 +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#1 +\[^\r\n\]*\\mmain\\M.*" "main bt"
415     }
416
417     # Try re-run if the new PIE displacement takes effect.
418     gdb_test "kill" "" "kill" {Kill the program being debugged\? \(y or n\) } "y"
419     reach "_dl_debug_state" "run" $displacement
420
421     if $ifmain {
422         test_core $file $displacement
423
424         test_attach $file $displacement
425     }
426
427     if !$trynosym {
428         return
429     }
430
431     global pf_prefix
432     set old_ldprefix $pf_prefix
433     lappend pf_prefix "symbol-less:"
434
435     # Test also `exec-file'-command loaded $FILE - therefore without symbols.
436     # SYMBOL_OBJFILE is not available and only EXEC_BFD must be used.
437
438     gdb_exit
439     gdb_start
440     # Clear it to never find any separate debug infos in $debug_root.
441     gdb_test_no_output "set debug-file-directory"
442     gdb_reinitialize_dir $srcdir/$subdir
443
444     # Print the "PIE (Position Independent Executable) displacement" message.
445     gdb_test_no_output "set verbose on"
446
447     # Test no (error) message has been printed by `exec-file'.
448     set escapedfile [string_to_regexp $file]
449     gdb_test "exec-file $file" "exec-file $escapedfile" "load"
450
451     if $ifmain {
452         reach "_dl_debug_state" run $displacement
453
454         # Use two separate gdb_test_multiple statements to avoid timeouts due
455         # to slow processing of wildcard capturing long output
456         set test "info files"
457         set entrynohex ""
458         gdb_test_multiple $test $test {
459             -re "\r\n\[\t \]*Entry point:\[\t \]*0x(\[0-9a-f\]+)\r\n" {
460                 set entrynohex $expect_out(1,string)
461                 gdb_test_multiple "" $test {
462                     -re "\r\n$gdb_prompt $" {
463                         pass $test
464                     }
465                 }
466             }
467         }
468
469         # `info sym' cannot be tested for .opd as the binary may not have
470         # symbols.
471         if {[istarget powerpc64-*] && [is_lp64_target]} {
472             set test "convert entry point"
473             gdb_test_multiple "p *(void(*)(void) *) 0x$entrynohex" $test {
474                 -re " =( \\(\[^0-9\]*\\))? 0x(\[0-9a-f\]+)( < \[^\r\n\]*)?\r\n$gdb_prompt $" {
475                     set entrynohex $expect_out(2,string)
476                     pass $test
477                 }
478             }
479         }
480         if {$entrynohex != ""} {
481             gdb_test "break *0x$entrynohex" "" "break at entry point"
482             gdb_test "continue" "\r\nBreakpoint \[0-9\]+, 0x0*$entrynohex in .*" "entry point reached"
483         }
484     } else {
485         # There is no symbol to break at ld.so.  Moreover it can exit with an
486         # error code.
487
488         set test "ld.so exit"
489         set test_displacement "seen displacement message as $displacement"
490         gdb_test_multiple "run" $test {
491             -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " {
492                 # Missing "$gdb_prompt $" is intentional.
493                 if {$expect_out(1,string) == "0x0"} {
494                     set case "ZERO"
495                 } else {
496                     set case "NONZERO"
497                 }
498                 if {$displacement == $case || $displacement == "PRESENT"} {
499                     pass $test_displacement
500                     set displacement "FOUND-$displacement"
501                 } else {
502                     fail $test_displacement
503                 }
504                 exp_continue
505             }
506             -re "$inferior_exited_re (normally|with code \[0-9\]+).\r\n$gdb_prompt $" {
507                 # Do not check the binary filename as it may be truncated.
508                 pass $test
509             }
510         }
511         if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
512             fail $test_displacement
513         }
514     }
515
516     set pf_prefix $old_ldprefix
517 }
518
519 # Create separate binaries for each testcase - to make the possible reported
520 # problem reproducible after the whole test run finishes.
521
522 set old_ldprefix $pf_prefix
523 foreach ldprelink {NO YES} {
524     foreach ldsepdebug {NO IN SEP} {
525         # Skip running the ldsepdebug test if we do not have system separate
526         # debug info available.
527         if {$interp_system_debug == "" && $ldsepdebug == "SEP"} {
528             continue
529         }
530
531         set ldname "LDprelink${ldprelink}debug${ldsepdebug}"
532         set interp $binprefix-$ldname
533
534         # prelink needs to always prelink all the dependencies to do any file
535         # modifications of its files.  ld.so also needs all the dependencies to
536         # be prelinked to omit the relocation process.  In-memory file offsets
537         # are not dependent whether ld.so went the prelink way or through the
538         # relocation process.
539         #
540         # For GDB we are not interested whether prelink succeeds as it is
541         # transparent to GDB.  GDB is being tested for differences of file
542         # offsets vs. in-memory offsets.  So we have to prelink even ld.so for
543         # the BIN modification to happen but we need to restore the original
544         # possibly unprelinked ld.so to test all the combinations for GDB.
545         set interp_saved ${interp}-saved
546
547         set pf_prefix $old_ldprefix
548         lappend pf_prefix "$ldname:"
549
550         if {$ldsepdebug == "NO"} {
551             file_copy $interp_system $interp
552             # Never call strip-debug before unprelink:
553             # prelink: ...: Section .note.gnu.build-id created after prelinking
554             if ![prelinkNO $interp] {
555                 continue
556             }
557             strip_debug $interp
558         } elseif {$ldsepdebug == "IN" && $interp_system_debug == ""} {
559             file_copy $interp_system $interp
560         } elseif {$ldsepdebug == "IN" && $interp_system_debug != ""} {
561             file_copy $interp_system $interp
562             file_copy $interp_system_debug "${interp}.debug"
563             # eu-unstrip: DWARF data in '...' not adjusted for prelinking bias; consider prelink -u
564             if {![prelinkNO $interp] || ![prelinkNO "${interp}.debug"]} {
565                 continue
566             }
567             set test "eu-unstrip unprelinked:[file tail $interp_system] + [file tail $interp_system_debug] to [file tail $interp]"
568             set command "exec eu-unstrip -o $interp $interp ${interp}.debug"
569             verbose -log "command is $command"
570             if [catch $command] {
571                 setup_xfail *-*-*
572                 fail $test
573                 continue
574             } else {
575                 pass $test
576             }
577         } elseif {$ldsepdebug == "SEP" && $interp_system_debug == ""} {
578             file_copy $interp_system $interp
579             # eu-unstrip: DWARF data in '...' not adjusted for prelinking bias; consider prelink -u
580             if ![prelinkNO $interp] {
581                 continue
582             }
583             gdb_gnu_strip_debug $interp
584         } elseif {$ldsepdebug == "SEP" && $interp_system_debug != ""} {
585             file_copy $interp_system $interp
586             file_copy $interp_system_debug "${interp}.debug"
587         }
588
589         if {$ldsepdebug == "SEP"} {
590             if ![prelinkNO "${interp}.debug"] {
591                 continue
592             }
593         } else {
594             file delete "${interp}.debug"
595         }
596
597         if ![prelink$ldprelink $interp] {
598             continue
599         }
600         if {$ldprelink == "NO"} {
601             set displacement "NONZERO"
602         } else {
603             # x86* kernel loads prelinked PIE binary at its prelinked address
604             # but ppc* kernel loads it at a random address.  prelink normally
605             # skips PIE binaries during the system scan.
606             set displacement "PRESENT"
607         }
608         test_ld $interp 0 [expr {$ldsepdebug == "NO"}] $displacement
609
610         if ![file_copy $interp $interp_saved] {
611             continue
612         }
613         set old_binprefix $pf_prefix
614         foreach binprelink {NO YES} {
615             foreach binsepdebug {NO IN SEP} {
616                 # "ATTACH" is like "YES" but it is modified during run.
617                 # It cannot be used for problem reproducibility after the
618                 # testcase ends.
619                 foreach binpie {NO YES ATTACH} {
620                     # This combination is not possible, non-PIE (fixed address)
621                     # binary cannot be prelinked to any (other) address.
622                     if {$binprelink == "YES" && $binpie == "NO"} {
623                         continue
624                     }
625
626                     set binname "BINprelink${binprelink}debug${binsepdebug}pie${binpie}"
627                     set exec $binprefix-$binname
628
629                     set pf_prefix $old_binprefix
630                     lappend pf_prefix "$binname:"
631
632                     set opts "ldflags=-Wl,$binfile_lib,-rpath,[file dirname $binfile_lib]"
633                     if {$binsepdebug != "NO"} {
634                         lappend opts {debug}
635                     }
636                     if {$binpie != "NO"} {
637                         lappend opts {additional_flags=-fPIE -pie}
638                     }
639
640                     set dir ${exec}.d
641                     set relink_args [build_executable_own_libs ${test}.exp [file tail $exec] $srcfile $opts $interp $dir]
642                     if {$relink_args == ""} {
643                         continue;
644                     }
645
646                     if {$binsepdebug == "SEP"} {
647                         gdb_gnu_strip_debug $exec
648                     }
649
650                     if {$binpie == "NO"} {
651                         set displacement "NONE"
652                     } elseif {$binprelink == "NO"} {
653                         set displacement "NONZERO"
654                     } else {
655                         # x86* kernel loads prelinked PIE binary at its
656                         # prelinked address but ppc* kernel loads it at
657                         # a random address.  prelink normally skips PIE
658                         # binaries during the system scan.
659                         set displacement "PRESENT"
660                     }
661
662                     if {[prelink$binprelink $relink_args [file tail $exec]]
663                         && [file_copy $interp_saved $interp]} {
664                         if {$binpie != "ATTACH"} {
665                             test_ld $exec 1 [expr {$binsepdebug == "NO"}] $displacement
666                         } else {
667                             # If the file has been randomly prelinked it must
668                             # be "NONZERO".  We could see "ZERO" only if it was
669                             # unprelinked and it is now running at the same
670                             # address - which is 0 but executable can never run
671                             # at address 0.
672
673                             set displacement "NONZERO"
674                             test_attach $exec $displacement $relink_args
675
676                             # ATTACH means that executables and libraries have
677                             # been modified after they have been run.  They
678                             # cannot be reused for problem reproducibility after
679                             # the testcase ends in the ATTACH case.  Therefore
680                             # they are rather deleted not to confuse after the
681                             # run finishes.
682                             set exec_debug [system_debug_get $exec]
683                             if {$exec_debug != ""} {
684                                 # `file delete [glob "${exec_debug}*"]' does not work.
685                                 foreach f [glob "${exec_debug}*"] {
686                                     file delete $f
687                                 }
688                             }
689                             file delete -force $dir
690                             # `file delete [glob "${exec}*"]' does not work.
691                             foreach f [glob "${exec}*"] {
692                                 file delete $f
693                             }
694                         }
695                     }
696                 }
697             }
698         }
699
700         file delete $interp_saved
701     }
702 }
703 set pf_prefix $old_ldprefix