From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25074 invoked by alias); 11 May 2011 09:03:16 -0000 Received: (qmail 25037 invoked by uid 22791); 11 May 2011 09:03:14 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 May 2011 09:03:00 +0000 Received: (qmail 27554 invoked from network); 11 May 2011 09:02:59 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 11 May 2011 09:02:59 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [patch#2] Regression: let gdb.base/reread.exp handle multiple binary files Date: Wed, 11 May 2011 09:03:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.6.2; x86_64; ; ) Cc: Jan Kratochvil , Janis Johnson References: <4DC18331.1020505@codesourcery.com> <20110508090803.GA4829@host1.jankratochvil.net> <20110511070812.GA32322@host1.jankratochvil.net> In-Reply-To: <20110511070812.GA32322@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105111003.06567.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00276.txt.bz2 On Wednesday 11 May 2011 08:08:13, Jan Kratochvil wrote: > 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. Looks good to me. > > > Thanks, > Jan > > > gdb/testsuite/ > 2011-05-08 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. > > --- 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 > } > } > > -- Pedro Alves