This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch#2] Regression: let gdb.base/reread.exp handle multiple binary files
On Sun, 08 May 2011 11:08:03 +0200, Jan Kratochvil wrote:
> 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.
Removed. I will check it in if no comments appear.
Thanks,
Jan
gdb/testsuite/
2011-05-08 Jan Kratochvil <jan.kratochvil@redhat.com>
* lib/gdb.exp (gdb_rename_execfile): Remove catch wrappers.
(gdb_touch_execfile): Remove catch wrappers. 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
@@ -2672,32 +2672,21 @@ proc exec_symbol_file { binfile } {
# Rename the executable file. Normally this is just BINFILE1 being renamed
# to BINFILE2, but some targets require multiple binary files.
proc gdb_rename_execfile { binfile1 binfile2 } {
- catch { file rename -force \
- [exec_target_file ${binfile1}] \
- [exec_target_file ${binfile2}] }
+ file rename -force [exec_target_file ${binfile1}] \
+ [exec_target_file ${binfile2}]
if { [exec_target_file ${binfile1}] != [exec_symbol_file ${binfile1}] } {
- catch { file rename -force \
- [exec_symbol_file ${binfile1}] \
- [exec_symbol_file ${binfile2}] }
+ file rename -force [exec_symbol_file ${binfile1}] \
+ [exec_symbol_file ${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]
+ 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}] }
+ file mtime [exec_symbol_file ${binfile}] $time
}
}