Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>,
	Janis Johnson <janisjo@codesourcery.com>
Subject: Re: [patch#2] Regression: let gdb.base/reread.exp handle multiple binary files
Date: Wed, 11 May 2011 09:03:00 -0000	[thread overview]
Message-ID: <201105111003.06567.pedro@codesourcery.com> (raw)
In-Reply-To: <20110511070812.GA32322@host1.jankratochvil.net>

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  <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
>      }
>  }
>  
> 

-- 
Pedro Alves


  reply	other threads:[~2011-05-11  9:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-04 16:47 [patch] " Janis Johnson
2011-05-04 17:55 ` Pedro Alves
2011-05-05 16:32   ` Janis Johnson
2011-05-07  6:05     ` Regression: " Jan Kratochvil
2011-05-08  9:08       ` [patch] Regression: " Jan Kratochvil
2011-05-11  7:08         ` [patch#2] " Jan Kratochvil
2011-05-11  9:03           ` Pedro Alves [this message]
2011-05-11  9:12             ` Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201105111003.06567.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=janisjo@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox