]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
introduce gdb_remote_download and finish parallel fixes in gdb.dwarf2
authorTom Tromey <tromey@redhat.com>
Thu, 22 Aug 2013 13:44:16 +0000 (13:44 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 22 Aug 2013 13:44:16 +0000 (13:44 +0000)
This finishes making gdb.dwarf2 parallel-safe.

To do this, this patch introduces a new gdb_remote_download proc, that
works somewhat differently in the one specific case where it matters:
for a copy to "host", if no destination was given, and the host is not
actually remote, then standard_output_file is used.  In parallel mode
this guarantees that the resulting file will end up in a parallel-safe
location.

Tested on x86-64 Fedora 18.

* gdb.dwarf2/dw2-basic.exp: Use gdb_remote_download.
* gdb.dwarf2/dw2-compressed.exp: Use gdb_remote_download.
* gdb.dwarf2/dw2-intercu.exp: Use gdb_remote_download.
* gdb.dwarf2/dw2-intermix.exp: Use gdb_remote_download.
* gdb.dwarf2/dw2-producer.exp: Use gdb_remote_download.
* gdb.dwarf2/mac-fileno.exp: Use gdb_remote_download.
* lib/gdb.exp (gdb_remote_download): New proc.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/dw2-basic.exp
gdb/testsuite/gdb.dwarf2/dw2-compressed.exp
gdb/testsuite/gdb.dwarf2/dw2-intercu.exp
gdb/testsuite/gdb.dwarf2/dw2-intermix.exp
gdb/testsuite/gdb.dwarf2/dw2-producer.exp
gdb/testsuite/gdb.dwarf2/mac-fileno.exp
gdb/testsuite/lib/gdb.exp

index f32933885d007a838e368b3c912b12ea53d3bb0b..c826d4e3d20c5e99050103d91fd534dfee0a0585 100644 (file)
@@ -1,3 +1,13 @@
+2013-08-22  Tom Tromey  <tromey@redhat.com>
+
+       * gdb.dwarf2/dw2-basic.exp: Use gdb_remote_download.
+       * gdb.dwarf2/dw2-compressed.exp: Use gdb_remote_download.
+       * gdb.dwarf2/dw2-intercu.exp: Use gdb_remote_download.
+       * gdb.dwarf2/dw2-intermix.exp: Use gdb_remote_download.
+       * gdb.dwarf2/dw2-producer.exp: Use gdb_remote_download.
+       * gdb.dwarf2/mac-fileno.exp: Use gdb_remote_download.
+       * lib/gdb.exp (gdb_remote_download): New proc.
+
 2013-08-22  Tom Tromey  <tromey@redhat.com>
 
        * gdb.dwarf2/clztest.exp: Use standard_testfile.
index a6f1d029ded1e76afc56a3a47ea0ade5e88e802b..0a935cba6e760ef84427148f4f791d0f6856afa6 100644 (file)
@@ -29,7 +29,8 @@ if {[prepare_for_testing_full $testfile.exp \
     return -1
 }
 
-set remote_dwarf_srcfile [remote_download host ${srcdir}/${subdir}/${dwarf_srcfile}]
+set remote_dwarf_srcfile [gdb_remote_download host \
+                             ${srcdir}/${subdir}/${dwarf_srcfile}]
 
 gdb_test_no_output "set listsize 1"
 gdb_test "list func_cu1" "4\[ \t\]+File 1 Line 4"
index ff3b8786ae1b067a61b71ba5b028a4306995d417..7f7a17a3ac8ac68272492da0a6b574f6a09e77a9 100644 (file)
@@ -31,7 +31,8 @@ if {[prepare_for_testing_full $testfile.exp \
     return -1
 }
 
-set remote_dwarf_srcfile [remote_download host ${srcdir}/${subdir}/${dwarf_srcfile}]
+set remote_dwarf_srcfile [gdb_remote_download host \
+                             ${srcdir}/${subdir}/${dwarf_srcfile}]
 
 gdb_test_no_output "set listsize 1"
 gdb_test "list func_cu1" "4\[ \t\]+File 1 Line 4"
index 1d7e852cfea686be3b67d13229415019f93b32e2..6f603c0e9975f6e9933465fb0deb6451e6ca43b6 100644 (file)
@@ -29,7 +29,8 @@ if {[prepare_for_testing_full $testfile.exp \
     return -1
 }
 
-set remote_dwarf_srcfile [remote_download host ${srcdir}/${subdir}/${dwarf_srcfile}]
+set remote_dwarf_srcfile [gdb_remote_download host \
+                             ${srcdir}/${subdir}/${dwarf_srcfile}]
 
 # This needs to be done first so that the CU for int2 gets expanded first.
 # This exercises the case where the type for this die is hashed, but we
index f2ebef1114cd87bff9b99b00673a632c96319313..5f14fae8cd0c2433741149e44ffecbf137b85736 100644 (file)
@@ -29,7 +29,8 @@ if {[prepare_for_testing_full $testfile.exp \
     return -1
 }
 
-set remote_dwarf_srcfile [remote_download host ${srcdir}/${subdir}/${dwarf_srcfile}]
+set remote_dwarf_srcfile [gdb_remote_download host \
+                             ${srcdir}/${subdir}/${dwarf_srcfile}]
 
 gdb_test_no_output "set listsize 1"
 gdb_test "list func_cu1" "4\[ \t\]+File 1 Line 4"
index 86154ba6bac46c18ca3ccf7c7f58ecc176b67068..383e25bf629e3e575984198a991459118740323d 100644 (file)
@@ -27,7 +27,8 @@ if {[prepare_for_testing_full $testfile.exp \
     return -1
 }
 
-set remote_dwarf_srcfile [remote_download host ${srcdir}/${subdir}/${dwarf_srcfile}]
+set remote_dwarf_srcfile [gdb_remote_download host \
+                             ${srcdir}/${subdir}/${dwarf_srcfile}]
 
 gdb_test_no_output "set listsize 1"
 gdb_test "list func_cu1" "4\[ \t\]+File 1 Line 4"
index 71999eb1e976a24cda25b4fdd9f7585c98cb7877..48415fdd86cb31cf9fd5e7de7ff15899f1be5355 100644 (file)
@@ -30,7 +30,8 @@ if {[prepare_for_testing_full $testfile.exp \
     return -1
 }
 
-set remote_dwarf_srcfile [remote_download host ${srcdir}/${subdir}/${dwarf_srcfile}]
+set remote_dwarf_srcfile [gdb_remote_download host \
+                             ${srcdir}/${subdir}/${dwarf_srcfile}]
 
 gdb_test_no_output "set listsize 1"
 gdb_test "list func_cu1" "4\[ \t\]+File 1 Line 4"
index a2f6a8f2ee6ad3da07e0eb53027279abeff4b827..52d369ca0d17a588682b7686bfe4db0bf003910f 100644 (file)
@@ -3263,6 +3263,18 @@ proc gdb_touch_execfile { binfile } {
     }
 }
 
+# Like remote_download but provides a gdb-specific behavior.  If DEST
+# is "host", and the host is not remote, and TOFILE is not specified,
+# then the [file tail] of FROMFILE is passed through
+# standard_output_file to compute the destination.
+
+proc gdb_remote_download {dest fromfile {tofile {}}} {
+    if {$dest == "host" && ![is_remote host] && $tofile == ""} {
+       set tofile [standard_output_file [file tail $fromfile]]
+    }
+    return [remote_download $dest $fromfile $tofile]
+}
+
 # gdb_download
 #
 # Copy a file to the remote target and return its target filename.