From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17821 invoked by alias); 11 May 2011 07:08:49 -0000 Received: (qmail 17812 invoked by uid 22791); 11 May 2011 07:08:48 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 May 2011 07:08:31 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4B78OVS005293 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 11 May 2011 03:08:24 -0400 Received: from host1.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p4B78Inu019887 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 11 May 2011 03:08:23 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p4B78HnC001615; Wed, 11 May 2011 09:08:17 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p4B78Dwt001594; Wed, 11 May 2011 09:08:13 +0200 Date: Wed, 11 May 2011 07:08:00 -0000 From: Jan Kratochvil To: Janis Johnson Cc: Pedro Alves , gdb-patches@sourceware.org Subject: [patch#2] Regression: let gdb.base/reread.exp handle multiple binary files Message-ID: <20110511070812.GA32322@host1.jankratochvil.net> References: <4DC18331.1020505@codesourcery.com> <201105041855.32567.pedro@codesourcery.com> <4DC2D106.3060806@codesourcery.com> <20110507060431.GA28099@host1.jankratochvil.net> <20110508090803.GA4829@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110508090803.GA4829@host1.jankratochvil.net> User-Agent: Mutt/1.5.21 (2010-09-15) 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/msg00272.txt.bz2 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 * 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 } }