Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] let gdb.base/reread.exp handle multiple binary files
@ 2011-05-04 16:47 Janis Johnson
  2011-05-04 17:55 ` Pedro Alves
  0 siblings, 1 reply; 8+ messages in thread
From: Janis Johnson @ 2011-05-04 16:47 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

Test gdb.base/reread.exp fails and reports ERROR for uClinux because it
renames binary files directly using "shell mv", and this doesn't take
into account the pair of binaries that are used for the bFLT format.

This patch moves the file commands into new procedures in lib/gdb.exp
that are used as defaults if the local environment doesn't override
them.

Tested on arm-none-linux-gnueabi as a platform that does not need
overrides.  OK?  I have an FSF copyright assignment for gdb.

Janis Johnson
CodeSourcery / Mentor Graphics

[-- Attachment #2: gdb-20110504-1 --]
[-- Type: text/plain, Size: 4418 bytes --]

20110-5-04  Janis Johnson  <janisjo@codesourcery.com>

	* lib/gdb.exp (exec_target_file, exec_symbol_file,
	gdb_rename_execfile, gdb_touch_execfile): New.
	* gdb.base/reread.exp: Use new procs to handle multiple
	exec files.

Index: gdb/testsuite/lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.172
diff -u -p -r1.172 gdb.exp
--- gdb/testsuite/lib/gdb.exp	27 Apr 2011 19:44:42 -0000	1.172
+++ gdb/testsuite/lib/gdb.exp	4 May 2011 16:07:25 -0000
@@ -2653,6 +2653,54 @@ proc shlib_symbol_file { libname } {
     return $libname
 }
 
+# Return the filename to download to the target and load for this
+# executable.  Normally just BINFILE unless it is renamed to something
+# else for this target.
+
+proc exec_target_file { binfile } {
+    return $binfile
+}
+
+# Return the filename GDB will load symbols from when debugging this
+# executable.  Normally just BINFILE unless executables for this target
+# have separate files for symbols.
+
+proc exec_symbol_file { binfile } {
+    return $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}] }
+    if { [exec_target_file ${binfile1}] != [exec_symbol_file ${binfile1}] } {
+	catch { 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}] }
+    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}] }
+    }
+}
+
 # gdb_download
 #
 # Copy a file to the remote target and return its target filename.
Index: gdb/testsuite/gdb.base/reread.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/reread.exp,v
retrieving revision 1.18
diff -u -p -r1.18 reread.exp
--- gdb/testsuite/gdb.base/reread.exp	7 Mar 2011 16:03:02 -0000	1.18
+++ gdb/testsuite/gdb.base/reread.exp	4 May 2011 16:07:25 -0000
@@ -53,7 +53,7 @@ gdb_reinitialize_dir $srcdir/$subdir
 
 # Load the first executable.
 
-gdb_test "shell mv ${binfile1} ${binfile}" ".*" ""
+gdb_rename_execfile ${binfile1} ${binfile}
 gdb_load ${binfile}
 
 # Set a breakpoint at foo
@@ -82,10 +82,10 @@ gdb_expect {
 # second executable into its place.  Ensure that the new
 # executable is at least a second newer than the old.
 
-gdb_test "shell mv ${binfile} ${binfile1}" ".*" ""
-gdb_test "shell mv ${binfile2} ${binfile}" ".*" ""
+gdb_rename_execfile ${binfile} ${binfile1}
+gdb_rename_execfile ${binfile2} ${binfile}
 gdb_test "shell sleep 1" ".*" ""
-gdb_test "shell touch ${binfile}" ".*" ""
+gdb_touch_execfile ${binfile}
 
 # Run a second time; GDB should detect that the executable has changed
 # and reset the breakpoints correctly.
@@ -120,8 +120,8 @@ if [is_remote target] {
 } else {
 
     # Put the older executable back in place.
-    gdb_test "shell mv ${binfile} ${binfile2}" ".*" ""
-    gdb_test "shell mv ${binfile1} ${binfile}" ".*" ""
+    gdb_rename_execfile ${binfile} ${binfile2}
+    gdb_rename_execfile ${binfile1} ${binfile}
 
     # Restart GDB entirely.
     gdb_start
@@ -154,8 +154,8 @@ if [is_remote target] {
     # Now move the newer executable into place, and re-run.  GDB
     # should still notice that the executable file has changed,
     # and still re-set the breakpoint appropriately.
-    gdb_test "shell mv ${binfile} ${binfile1}" ".*" ""
-    gdb_test "shell mv ${binfile2} ${binfile}" ".*" ""
+    gdb_rename_execfile ${binfile} ${binfile1}
+    gdb_rename_execfile ${binfile2} ${binfile}
     gdb_run_cmd
     gdb_expect {
 	-re ".*Breakpoint.* foo .* at .*:9.*$gdb_prompt $" {

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] let gdb.base/reread.exp handle multiple binary files
  2011-05-04 16:47 [patch] let gdb.base/reread.exp handle multiple binary files Janis Johnson
@ 2011-05-04 17:55 ` Pedro Alves
  2011-05-05 16:32   ` Janis Johnson
  0 siblings, 1 reply; 8+ messages in thread
From: Pedro Alves @ 2011-05-04 17:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Janis Johnson

On Wednesday 04 May 2011 17:47:45, Janis Johnson wrote:
>   20110-5-04  Janis Johnson  <janisjo@codesourcery.com>

Typo.

> 
>         * lib/gdb.exp (exec_target_file, exec_symbol_file,
>         gdb_rename_execfile, gdb_touch_execfile): New.
>         * gdb.base/reread.exp: Use new procs to handle multiple
>         exec files.

Okay.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] let gdb.base/reread.exp handle multiple binary files
  2011-05-04 17:55 ` Pedro Alves
@ 2011-05-05 16:32   ` Janis Johnson
  2011-05-07  6:05     ` Regression: " Jan Kratochvil
  0 siblings, 1 reply; 8+ messages in thread
From: Janis Johnson @ 2011-05-05 16:32 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On 05/04/2011 10:55 AM, Pedro Alves wrote:
> On Wednesday 04 May 2011 17:47:45, Janis Johnson wrote:
>>   20110-5-04  Janis Johnson  <janisjo@codesourcery.com>
> 
> Typo.
> 
>>
>>         * lib/gdb.exp (exec_target_file, exec_symbol_file,
>>         gdb_rename_execfile, gdb_touch_execfile): New.
>>         * gdb.base/reread.exp: Use new procs to handle multiple
>>         exec files.
> 
> Okay.

Thanks, I got set up with write access and checked it in.

Janis


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Regression: Re: [patch] let gdb.base/reread.exp handle multiple binary files
  2011-05-05 16:32   ` Janis Johnson
@ 2011-05-07  6:05     ` Jan Kratochvil
  2011-05-08  9:08       ` [patch] Regression: " Jan Kratochvil
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Kratochvil @ 2011-05-07  6:05 UTC (permalink / raw)
  To: Janis Johnson; +Cc: Pedro Alves, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1403 bytes --]

On Thu, 05 May 2011 18:32:06 +0200, Janis Johnson wrote:
> On 05/04/2011 10:55 AM, Pedro Alves wrote:
> > On Wednesday 04 May 2011 17:47:45, Janis Johnson wrote:
> >>         * lib/gdb.exp (exec_target_file, exec_symbol_file,
> >>         gdb_rename_execfile, gdb_touch_execfile): New.
> >>         * gdb.base/reread.exp: Use new procs to handle multiple
> >>         exec files.
> > 
> > Okay.
> 
> Thanks, I got set up with write access and checked it in.

-PASS: gdb.base/reread.exp: run to foo() second time
+FAIL: gdb.base/reread.exp: run to foo() second time
-PASS: gdb.base/reread.exp: second pass: run to foo() second time
+FAIL: gdb.base/reread.exp: second pass: run to foo() second time

52dbcea59b9496cbbdfe0ca30c0308b16e892c0d is the first bad commit
commit 52dbcea59b9496cbbdfe0ca30c0308b16e892c0d
Author: janis <janis>
Date:   Thu May 5 16:29:57 2011 +0000

	* lib/gdb.exp (exec_target_file, exec_symbol_file,
	gdb_rename_execfile, gdb_touch_execfile): New.
	* gdb.base/reread.exp: Use new procs to handle multiple
	exec files.

:040000 040000 21dd778fff93776e04803a94be62e784971e25b9 bde8683b59aaf5806cc96c6a3f8f8ae30a128a2f M      gdb
bisect run success

On {x86_64,x86_64-m32,i686}-fedora{13,14,15,rawhide}-linux-gnu.

It reliably PASSed before, now it FAILs in 90% of cases but occasionally
PASSes, there is some race, I will check it later, it may be machine
dependent.


Thanks,
Jan

[-- Attachment #2: 1 --]
[-- Type: text/plain, Size: 4439 bytes --]

diff -dup -ru pass/gdb.log fail/gdb.log
--- pass/gdb.log	2011-05-07 07:55:06.000000000 +0200
+++ fail/gdb.log	2011-05-07 07:59:23.000000000 +0200
@@ -1,4 +1,4 @@
-Test Run By jkratoch on Sat May  7 07:55:04 2011
+Test Run By jkratoch on Sat May  7 07:59:22 2011
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== gdb tests ===
@@ -49,19 +49,17 @@ shell sleep 1
 (gdb) run 
 The program being debugged has been started already.
 Start it from the beginning? (y or n) y
-`/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.base/reread' has changed; re-reading symbols.
 Starting program: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.base/reread 
-
-Breakpoint 1, foo () at ./gdb.base/reread2.c:9
-9	  x++;
-(gdb) PASS: gdb.base/reread.exp: run to foo() second time
+This is foo
+[Inferior 1 (process 2994) exited normally]
+(gdb) FAIL: gdb.base/reread.exp: run to foo() second time
 dir
 Reinitialize source path to empty? (y or n) y
 Source directories searched: $cdir:$cwd
 (gdb) dir ./gdb.base
 Source directories searched: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/./gdb.base:$cdir:$cwd
 (gdb) kill
-Kill the program being debugged? (y or n) y
+The program is not being run.
 (gdb) file /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.base/reread
 Load new symbol table from "/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.base/reread"? (y or n) y
 Reading symbols from /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.base/reread...done.
@@ -77,20 +75,19 @@ Breakpoint 1, foo () at ./gdb.base/rerea
 (gdb) PASS: gdb.base/reread.exp: second pass: run to foo()
 continue
 Continuing.
-[Inferior 1 (process 28071) exited normally]
+[Inferior 1 (process 3000) exited normally]
 (gdb) PASS: gdb.base/reread.exp: continue until exit at second pass
 run 
-`/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.base/reread' has changed; re-reading symbols.
 Starting program: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.base/reread 
-
-Breakpoint 1, foo () at ./gdb.base/reread2.c:9
-9	  x++;
-(gdb) PASS: gdb.base/reread.exp: second pass: run to foo() second time
-testcase ./gdb.base/reread.exp completed in 2 seconds
+This is foo
+[Inferior 1 (process 3003) exited normally]
+(gdb) FAIL: gdb.base/reread.exp: second pass: run to foo() second time
+testcase ./gdb.base/reread.exp completed in 1 seconds
 
 		=== gdb Summary ===
 
-# of expected passes		7
+# of expected passes		5
+# of unexpected failures	2
 Executing on host: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/jkratoch/redhat/gdb-clean/gdb/testsuite/../data-directory --version    (timeout = 300)
 spawn -ignore SIGHUP /home/jkratoch/redhat/gdb-clean/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/jkratoch/redhat/gdb-clean/gdb/testsuite/../data-directory --version
 GNU gdb (GDB) 7.3.50.20110506-cvs
@@ -104,4 +101,4 @@ For bug reporting instructions, please s
 <http://www.gnu.org/software/gdb/bugs/>.
 /home/jkratoch/redhat/gdb-clean/gdb/testsuite/../../gdb/gdb version  7.3.50.20110506-cvs -nw -nx -data-directory /home/jkratoch/redhat/gdb-clean/gdb/testsuite/../data-directory 
 
-runtest completed at Sat May  7 07:55:06 2011
+runtest completed at Sat May  7 07:59:23 2011
diff -dup -ru pass/gdb.sum fail/gdb.sum
--- pass/gdb.sum	2011-05-07 07:55:06.000000000 +0200
+++ fail/gdb.sum	2011-05-07 07:59:23.000000000 +0200
@@ -1,4 +1,4 @@
-Test Run By jkratoch on Sat May  7 07:55:04 2011
+Test Run By jkratoch on Sat May  7 07:59:22 2011
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== gdb tests ===
@@ -10,14 +10,15 @@ Running target unix
 Running ./gdb.base/reread.exp ...
 PASS: gdb.base/reread.exp: breakpoint foo in first file
 PASS: gdb.base/reread.exp: run to foo()
-PASS: gdb.base/reread.exp: run to foo() second time
+FAIL: gdb.base/reread.exp: run to foo() second time
 PASS: gdb.base/reread.exp: second pass: breakpoint foo in first file
 PASS: gdb.base/reread.exp: second pass: run to foo()
 PASS: gdb.base/reread.exp: continue until exit at second pass
-PASS: gdb.base/reread.exp: second pass: run to foo() second time
+FAIL: gdb.base/reread.exp: second pass: run to foo() second time
 
 		=== gdb Summary ===
 
-# of expected passes		7
+# of expected passes		5
+# of unexpected failures	2
 /home/jkratoch/redhat/gdb-clean/gdb/testsuite/../../gdb/gdb version  7.3.50.20110506-cvs -nw -nx -data-directory /home/jkratoch/redhat/gdb-clean/gdb/testsuite/../data-directory 
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [patch]  Regression: let gdb.base/reread.exp handle multiple binary files
  2011-05-07  6:05     ` Regression: " Jan Kratochvil
@ 2011-05-08  9:08       ` Jan Kratochvil
  2011-05-11  7:08         ` [patch#2] " Jan Kratochvil
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Kratochvil @ 2011-05-08  9:08 UTC (permalink / raw)
  To: Janis Johnson; +Cc: Pedro Alves, gdb-patches

Hello Janis,

tcl `file -copy' really preserves file attributes / modification time, at
least on tcl-8.5.9-3.fc15.x86_64.

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.


Thanks,
Jan


gdb/testsuite/
2011-05-08  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* lib/gdb.exp (gdb_touch_execfile): 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
@@ -2685,19 +2685,10 @@ proc gdb_rename_execfile { binfile1 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]
+    catch "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}] }
+	catch "file mtime \"[exec_symbol_file ${binfile}]\" $time"
     }
 }
 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [patch#2] Regression: let gdb.base/reread.exp handle multiple binary files
  2011-05-08  9:08       ` [patch] Regression: " Jan Kratochvil
@ 2011-05-11  7:08         ` Jan Kratochvil
  2011-05-11  9:03           ` Pedro Alves
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Kratochvil @ 2011-05-11  7:08 UTC (permalink / raw)
  To: Janis Johnson; +Cc: Pedro Alves, gdb-patches

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch#2] Regression: let gdb.base/reread.exp handle multiple binary files
  2011-05-11  7:08         ` [patch#2] " Jan Kratochvil
@ 2011-05-11  9:03           ` Pedro Alves
  2011-05-11  9:12             ` Jan Kratochvil
  0 siblings, 1 reply; 8+ messages in thread
From: Pedro Alves @ 2011-05-11  9:03 UTC (permalink / raw)
  To: gdb-patches; +Cc: Jan Kratochvil, Janis Johnson

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch#2] Regression: let gdb.base/reread.exp handle multiple binary files
  2011-05-11  9:03           ` Pedro Alves
@ 2011-05-11  9:12             ` Jan Kratochvil
  0 siblings, 0 replies; 8+ messages in thread
From: Jan Kratochvil @ 2011-05-11  9:12 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Janis Johnson

On Wed, 11 May 2011 11:03:06 +0200, Pedro Alves wrote:
> On Wednesday 11 May 2011 08:08:13, Jan Kratochvil wrote:
> > 	* 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.
> 
> Looks good to me.

Checked in:
	http://sourceware.org/ml/gdb-cvs/2011-05/msg00070.html


Thanks,
Jan


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-05-11  9:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-04 16:47 [patch] let gdb.base/reread.exp handle multiple binary files 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
2011-05-11  9:12             ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox