From faf067f1a354df9682137d4910540c74ee7c929c Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Wed, 11 May 2011 09:11:17 +0000 Subject: [PATCH] gdb/testsuite/ * 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. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/lib/gdb.exp | 25 +++++++------------------ 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index fd82e53..d855ea2 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2011-05-11 Jan Kratochvil + * 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. + +2011-05-11 Jan Kratochvil + * gdb.base/readline-ask.c: New file. * gdb.base/readline-ask.exp: New file. * gdb.base/readline-ask.inputrc: New file. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index c50a732..17ea0b7 100644 --- 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 } } -- 2.7.4