This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] Regression: let gdb.base/reread.exp handle multiple binary files
Hello Janis,
tcl `file -copy' really preserves file attributes / modification time, at
least on tcl-8.5.9-3.fc15.x86_64.
Does this patch work even on the exotic platform(s)?
Also I would prefer to remove those `catch'es - the functionality of
gdb_rename_execfile and gdb_touch_execfile is essential to gdb/reread.exp, if
errors occur gdb/reread.exp cannot work and such hidden error will just
confuse the testfile results afterwards.
Thanks,
Jan
gdb/testsuite/
2011-05-08 Jan Kratochvil <jan.kratochvil@redhat.com>
* lib/gdb.exp (gdb_touch_execfile): New variable time. Replace `file
copy' and `file rename' by `file mtime'. Twice.
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2685,19 +2685,10 @@ proc gdb_rename_execfile { binfile1 binfile2 } {
# "Touch" the executable file to update the date. Normally this is just
# BINFILE, but some targets require multiple files.
proc gdb_touch_execfile { binfile } {
- catch { file copy -force \
- [exec_target_file ${binfile}] \
- [exec_target_file ${binfile}.tmp] }
- catch { file rename -force \
- [exec_target_file ${binfile}.tmp] \
- [exec_target_file ${binfile}] }
+ set time [clock seconds]
+ catch "file mtime \"[exec_target_file ${binfile}]\" $time"
if { [exec_target_file ${binfile}] != [exec_symbol_file ${binfile}] } {
- catch { file copy -force \
- [exec_symbol_file ${binfile}] \
- [exec_symbol_file ${binfile}.tmp] }
- catch { file rename -force \
- [exec_symbol_file ${binfile}.tmp] \
- [exec_symbol_file ${binfile}] }
+ catch "file mtime \"[exec_symbol_file ${binfile}]\" $time"
}
}