public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/5] more parallelization fixes
@ 2013-08-13 21:03 Tom Tromey
  2013-08-13 21:03 ` [PATCH 5/5] fix gdb.arch to be parallel-safe Tom Tromey
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Tom Tromey @ 2013-08-13 21:03 UTC (permalink / raw)
  To: gdb-patches

This series updates more parts of the test suite to be parallel-safe.
I think the patches are all reasonably straightforward.

After this series, we still aren't really done, but we're much closer
to the end.  I think there will be one more series like this one --
just updates to various tests -- and then the final patches to modify
the Makefiles and switch "make -jN check" to the new scheme.  At that
point I'll also dig up my notes and (re-)post some information about
how well the test suite scales.

Tom

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

* [PATCH 1/5] fix some gdb.dwarf2 tests for parallel safety
  2013-08-13 21:03 [PATCH 0/5] more parallelization fixes Tom Tromey
  2013-08-13 21:03 ` [PATCH 5/5] fix gdb.arch to be parallel-safe Tom Tromey
  2013-08-13 21:03 ` [PATCH 2/5] introduce gdb_remote_download and finish parallel fixes in gdb.dwarf2 Tom Tromey
@ 2013-08-13 21:03 ` Tom Tromey
  2013-08-27 15:16   ` Testsuite regression for fission + gdbindex run [Re: [PATCH 1/5] fix some gdb.dwarf2 tests for parallel safety] Jan Kratochvil
  2013-08-13 21:03 ` [PATCH 3/5] use standard_temp_file in another caching proc Tom Tromey
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2013-08-13 21:03 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This fixes a few gdb.dwarf2 tests to be more parallel-safe.  This
mostly amounts to changing them to write their files into the
directory designated by standard_output_file.

Built and regtested on x86-64 Fedora 18.

	* gdb.dwarf2/clztest.exp: Use standard_testfile.
	* gdb.dwarf2/dw2-minsym-in-cu.exp: Use standard_testfile.
	* gdb.dwarf2/fission-base.S: Remove directory from
	DW_AT_GNU_dwo_name.
	* gdb.dwarf2/fission-base.exp: Use build_executable.  Set
	debug-file-directory.
	* gdb.dwarf2/fission-reread.S: Remove directory from
	DW_AT_GNU_dwo_name.
	* gdb.dwarf2/fission-reread.exp: Use build_executable.  Set
	debug-file-directory.
---
 gdb/testsuite/gdb.dwarf2/clztest.exp          |  1 +
 gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp |  6 ++----
 gdb/testsuite/gdb.dwarf2/fission-base.S       |  5 +----
 gdb/testsuite/gdb.dwarf2/fission-base.exp     | 11 ++++++++++-
 gdb/testsuite/gdb.dwarf2/fission-reread.S     |  7 ++-----
 gdb/testsuite/gdb.dwarf2/fission-reread.exp   | 11 ++++++++++-
 6 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/gdb/testsuite/gdb.dwarf2/clztest.exp b/gdb/testsuite/gdb.dwarf2/clztest.exp
index 127fbdf..0874342 100644
--- a/gdb/testsuite/gdb.dwarf2/clztest.exp
+++ b/gdb/testsuite/gdb.dwarf2/clztest.exp
@@ -15,6 +15,7 @@
 
 load_lib dwarf.exp
 
+standard_testfile .S
 set test "clztest"
 
 # This test can only be run on targets which support DWARF-2 and use gas.
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp b/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp
index 105123f..9b2a805 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp
@@ -21,11 +21,9 @@ if {![dwarf2_support]} {
 
 # This testfile has reproducibility only with cc-with-index.sh.
 
-set testfile "dw2-minsym-in-cu"
-set srcfile ${testfile}.S
-set executable ${testfile}
+standard_testfile .S
 
-if [prepare_for_testing ${testfile}.exp ${executable} ${srcfile}] {
+if [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.dwarf2/fission-base.S b/gdb/testsuite/gdb.dwarf2/fission-base.S
index 23de5a7..14b2494 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-base.S
+++ b/gdb/testsuite/gdb.dwarf2/fission-base.S
@@ -145,10 +145,7 @@ main:
 	.ascii "/tmp/src/gdb/testsuite\0"	# DW_AT_comp_dir
 	# Normally dwo_name would be "fission-base.dwo".
 	# Simplification: Leave the DWO contents in the executable.
-	# "gdb.dwarf2/" is included so that gdb can load the file without
-	# having to set "debug-file-directory".  This is useful when
-	# testing with cc-with-tweaks.sh -i.
-	.ascii "gdb.dwarf2/fission-base\0"	# DW_AT_GNU_dwo_name
+	.ascii "fission-base\0"	# DW_AT_GNU_dwo_name
 	.4byte	.Ldebug_pubnames0	# DW_AT_GNU_pubnames
 	.4byte	.Ldebug_pubtypes0	# DW_AT_GNU_pubtypes
 	.4byte	.Ldebug_addr0_begin	# DW_AT_GNU_addr_base
diff --git a/gdb/testsuite/gdb.dwarf2/fission-base.exp b/gdb/testsuite/gdb.dwarf2/fission-base.exp
index 88e4ff1..58448f8 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-base.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-base.exp
@@ -29,10 +29,19 @@ set basename "fission-base"
 
 standard_testfile .S
 
-if { [prepare_for_testing "$testfile.exp" "$testfile" "$srcfile" {nodebug}] } {
+if { [build_executable "$testfile.exp" "$testfile" "$srcfile" {nodebug}] } {
     return -1
 }
 
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test_no_output "set debug-file-directory [file dirname $binfile]" \
+    "set debug-file-directory"
+
+gdb_load ${binfile}
+
 if ![runto_main] {
     return -1
 }
diff --git a/gdb/testsuite/gdb.dwarf2/fission-reread.S b/gdb/testsuite/gdb.dwarf2/fission-reread.S
index c598824..e566cc6 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-reread.S
+++ b/gdb/testsuite/gdb.dwarf2/fission-reread.S
@@ -135,11 +135,8 @@ main:
 	.uleb128 0x2	/* (DIE (0) DW_TAG_type_unit) */
 	.ascii "/tmp/src/gdb/testsuite\0"	/* DW_AT_comp_dir */
 	/* Normally dwo_name would be "fission-reread.dwo".
-	   Simplification: Leave the DWO contents in the executable.
-	   "gdb.dwarf2/" is included so that gdb can load the file without
-	   having to set "debug-file-directory".  This is useful when
-	   testing with cc-with-tweaks.sh -i.  */
-	.ascii "gdb.dwarf2/fission-reread\0"	/* DW_AT_GNU_dwo_name */
+	   Simplification: Leave the DWO contents in the executable.  */
+	.ascii "fission-reread\0"	/* DW_AT_GNU_dwo_name */
 	.4byte	.Ldebug_pubnames0	/* DW_AT_GNU_pubnames */
 	.4byte	.Ldebug_pubtypes0	/* DW_AT_GNU_pubtypes */
 	.4byte	.Ldebug_addr0	/* DW_AT_GNU_addr_base */
diff --git a/gdb/testsuite/gdb.dwarf2/fission-reread.exp b/gdb/testsuite/gdb.dwarf2/fission-reread.exp
index 0f06326..f275308 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-reread.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-reread.exp
@@ -24,10 +24,19 @@ set basename "fission-reread"
 
 standard_testfile .S
 
-if { [prepare_for_testing "$testfile.exp" "$testfile" "$srcfile" {nodebug}] } {
+if { [build_executable "$testfile.exp" "$testfile" "$srcfile" {nodebug}] } {
     return -1
 }
 
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test_no_output "set debug-file-directory [file dirname $binfile]" \
+    "set debug-file-directory"
+
+gdb_load ${binfile}
+
 gdb_test "break main" "Breakpoint.*at.*"
 
 # If we get this far gdb didn't crash, nor did an error occur.
-- 
1.8.1.4

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

* [PATCH 2/5] introduce gdb_remote_download and finish parallel fixes in gdb.dwarf2
  2013-08-13 21:03 [PATCH 0/5] more parallelization fixes Tom Tromey
  2013-08-13 21:03 ` [PATCH 5/5] fix gdb.arch to be parallel-safe Tom Tromey
@ 2013-08-13 21:03 ` Tom Tromey
  2013-08-26  2:20   ` Yao Qi
  2013-08-13 21:03 ` [PATCH 1/5] fix some gdb.dwarf2 tests for parallel safety Tom Tromey
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2013-08-13 21:03 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

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/gdb.dwarf2/dw2-basic.exp      |  3 ++-
 gdb/testsuite/gdb.dwarf2/dw2-compressed.exp |  3 ++-
 gdb/testsuite/gdb.dwarf2/dw2-intercu.exp    |  3 ++-
 gdb/testsuite/gdb.dwarf2/dw2-intermix.exp   |  3 ++-
 gdb/testsuite/gdb.dwarf2/dw2-producer.exp   |  3 ++-
 gdb/testsuite/gdb.dwarf2/mac-fileno.exp     |  3 ++-
 gdb/testsuite/lib/gdb.exp                   | 12 ++++++++++++
 7 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/gdb.dwarf2/dw2-basic.exp b/gdb/testsuite/gdb.dwarf2/dw2-basic.exp
index a6f1d02..0a935cb 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-basic.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-basic.exp
@@ -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"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp b/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp
index ff3b878..7f7a17a 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp
@@ -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"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp b/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp
index 1d7e852..6f603c0 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp
@@ -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
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp b/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp
index f2ebef1..5f14fae 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp
@@ -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"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-producer.exp b/gdb/testsuite/gdb.dwarf2/dw2-producer.exp
index 86154ba..383e25b 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-producer.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-producer.exp
@@ -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"
diff --git a/gdb/testsuite/gdb.dwarf2/mac-fileno.exp b/gdb/testsuite/gdb.dwarf2/mac-fileno.exp
index 71999eb..48415fd 100644
--- a/gdb/testsuite/gdb.dwarf2/mac-fileno.exp
+++ b/gdb/testsuite/gdb.dwarf2/mac-fileno.exp
@@ -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"
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index a2f6a8f..52d369c 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -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.
-- 
1.8.1.4

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

* [PATCH 3/5] use standard_temp_file in another caching proc
  2013-08-13 21:03 [PATCH 0/5] more parallelization fixes Tom Tromey
                   ` (2 preceding siblings ...)
  2013-08-13 21:03 ` [PATCH 1/5] fix some gdb.dwarf2 tests for parallel safety Tom Tromey
@ 2013-08-13 21:03 ` Tom Tromey
  2013-08-13 21:03 ` [PATCH 4/5] fix gdb.python to be parallel-safe Tom Tromey
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Tom Tromey @ 2013-08-13 21:03 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

In an earlier patch I forgot to change the caching proc in cell.exp to
use standard_temp_file.  This fixes the oversight.

Tested on x86-64 Fedora 18.

       * lib/cell.exp (skip_cell_tests): Use standard_temp_file.
---
 gdb/testsuite/lib/cell.exp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/lib/cell.exp b/gdb/testsuite/lib/cell.exp
index 9a20f5c..448bd0a 100644
--- a/gdb/testsuite/lib/cell.exp
+++ b/gdb/testsuite/lib/cell.exp
@@ -78,10 +78,10 @@ gdb_caching_proc skip_cell_tests {
     # Set up, compile, and execute a combined Cell/B.E. test program.
     # Include the current process ID in the file names to prevent conflicts
     # with invocations for multiple testsuites.
-    set src cell[pid].c
-    set exe cell[pid].x
-    set src_spu cell[pid]-spu.c
-    set exe_spu cell[pid]-spu.x
+    set src [standard_temp_file cell[pid].c]
+    set exe [standard_temp_file cell[pid].x]
+    set src_spu [standard_temp_file cell[pid]-spu.c]
+    set exe_spu [standard_temp_file cell[pid]-spu.x]
 
     set f [open $src "w"]
     puts $f "#include <libspe2.h>"
-- 
1.8.1.4

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

* [PATCH 5/5] fix gdb.arch to be parallel-safe
  2013-08-13 21:03 [PATCH 0/5] more parallelization fixes Tom Tromey
@ 2013-08-13 21:03 ` Tom Tromey
  2013-08-14  8:33   ` Pedro Alves
  2013-08-13 21:03 ` [PATCH 2/5] introduce gdb_remote_download and finish parallel fixes in gdb.dwarf2 Tom Tromey
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2013-08-13 21:03 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This fixes parts of gdb.arch to be parallel-safe.
I only changed the bits I could test on this machine.

I don't have access to many of the machines needed to fully switch
gdb.arch; but I am happy to provide advice to others attempting this.
Or, I can send an untested patch to convert it all.

Tested on x86-64 Fedora 18.

	* gdb.arch/amd64-byte.exp: Use standard_testfile,
	clean_restart.
	* gdb.arch/amd64-disp-step.exp: Use standard_testfile.
	* gdb.arch/amd64-dword.exp: Use standard_testfile,
	clean_restart.
	* gdb.arch/amd64-entry-value-param.exp: Use standard_testfile.
	* gdb.arch/amd64-entry-value.exp: Use standard_testfile.
	* gdb.arch/amd64-prologue-xmm.exp: Use standard_testfile.
	* gdb.arch/amd64-word.exp: Use standard_testfile,
	clean_restart.
	* gdb.arch/i386-avx.exp: Use standard_testfile, clean_restart.
	* gdb.arch/i386-byte.exp: Use standard_testfile, clean_restart.
	* gdb.arch/i386-disp-step.exp: Use standard_testfile.
	* gdb.arch/i386-dr3-watch.exp: Use standard_testfile.
	* gdb.arch/i386-permbkpt.exp: Use standard_testfile, clean_restart.
	* gdb.arch/i386-signal.exp: Use standard_testfile.
	* gdb.arch/i386-size-overlap.exp: Use standard_testfile, clean_restart.
	* gdb.arch/i386-sse.exp: Use standard_testfile, clean_restart.
	* gdb.arch/i386-unwind.exp: Use standard_testfile.
	* gdb.arch/i386-word.exp: Use standard_testfile, clean_restart.
---
 gdb/testsuite/gdb.arch/amd64-byte.exp              | 9 ++-------
 gdb/testsuite/gdb.arch/amd64-disp-step.exp         | 4 +---
 gdb/testsuite/gdb.arch/amd64-dword.exp             | 9 ++-------
 gdb/testsuite/gdb.arch/amd64-entry-value-param.exp | 8 +++-----
 gdb/testsuite/gdb.arch/amd64-entry-value.exp       | 3 +--
 gdb/testsuite/gdb.arch/amd64-prologue-xmm.exp      | 7 +++----
 gdb/testsuite/gdb.arch/amd64-word.exp              | 9 ++-------
 gdb/testsuite/gdb.arch/i386-avx.exp                | 9 ++-------
 gdb/testsuite/gdb.arch/i386-byte.exp               | 9 ++-------
 gdb/testsuite/gdb.arch/i386-disp-step.exp          | 4 +---
 gdb/testsuite/gdb.arch/i386-dr3-watch.exp          | 5 ++---
 gdb/testsuite/gdb.arch/i386-permbkpt.exp           | 9 ++-------
 gdb/testsuite/gdb.arch/i386-signal.exp             | 4 +---
 gdb/testsuite/gdb.arch/i386-size-overlap.exp       | 4 +---
 gdb/testsuite/gdb.arch/i386-sse.exp                | 9 ++-------
 gdb/testsuite/gdb.arch/i386-unwind.exp             | 4 +---
 gdb/testsuite/gdb.arch/i386-word.exp               | 9 ++-------
 17 files changed, 30 insertions(+), 85 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/amd64-byte.exp b/gdb/testsuite/gdb.arch/amd64-byte.exp
index 0b908fa..c4774e6 100644
--- a/gdb/testsuite/gdb.arch/amd64-byte.exp
+++ b/gdb/testsuite/gdb.arch/amd64-byte.exp
@@ -24,9 +24,7 @@ if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
     return
 }
 
-set testfile "amd64-byte"
-set srcfile amd64-pseudo.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile amd64-pseudo.c
 
 if [get_compiler_info] {
     return -1
@@ -37,10 +35,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list
     return
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if ![runto_main] then {
     gdb_suppress_tests
diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step.exp b/gdb/testsuite/gdb.arch/amd64-disp-step.exp
index 14a65d3..1ad39cc 100644
--- a/gdb/testsuite/gdb.arch/amd64-disp-step.exp
+++ b/gdb/testsuite/gdb.arch/amd64-disp-step.exp
@@ -25,9 +25,7 @@ if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
 
 set newline "\[\r\n\]*"
 
-set testfile "amd64-disp-step"
-set srcfile ${testfile}.S
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .S
 
 set additional_flags "-Wa,-g"
 
diff --git a/gdb/testsuite/gdb.arch/amd64-dword.exp b/gdb/testsuite/gdb.arch/amd64-dword.exp
index 7b5cab7..759cd0e 100644
--- a/gdb/testsuite/gdb.arch/amd64-dword.exp
+++ b/gdb/testsuite/gdb.arch/amd64-dword.exp
@@ -24,9 +24,7 @@ if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
     return
 }
 
-set testfile "amd64-dword"
-set srcfile amd64-pseudo.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile amd64-pseudo.c
 
 if [get_compiler_info] {
     return -1
@@ -37,10 +35,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list
     return
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if ![runto_main] then {
     gdb_suppress_tests
diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-param.exp b/gdb/testsuite/gdb.arch/amd64-entry-value-param.exp
index 4197ed8..e44b6ff 100644
--- a/gdb/testsuite/gdb.arch/amd64-entry-value-param.exp
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-param.exp
@@ -13,14 +13,12 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set testfile amd64-entry-value-param
-set srcfile ${testfile}.S
-set csrcfile ${testfile}.c
+standard_testfile .S .c
 set opts {}
 
 if [info exists COMPILE] {
     # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value-param.exp COMPILE=1"
-    set srcfile ${csrcfile}
+    set srcfile ${srcfile2}
     lappend opts debug optimize=-O2
 } elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
     verbose "Skipping amd64-entry-value-param."
@@ -35,7 +33,7 @@ if ![runto_main] {
     return -1
 }
 
-set srcfile $csrcfile
+set srcfile $srcfile2
 gdb_breakpoint [gdb_get_line_number "break-here"]
 
 gdb_continue_to_breakpoint "break-here" ".* break-here .*"
diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value.exp b/gdb/testsuite/gdb.arch/amd64-entry-value.exp
index df6cb27..2393a71 100644
--- a/gdb/testsuite/gdb.arch/amd64-entry-value.exp
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value.exp
@@ -13,8 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set testfile amd64-entry-value
-set srcfile ${testfile}.s
+standard_testfile .s
 set opts {}
 
 if [info exists COMPILE] {
diff --git a/gdb/testsuite/gdb.arch/amd64-prologue-xmm.exp b/gdb/testsuite/gdb.arch/amd64-prologue-xmm.exp
index 28ad9b4..6fafa26 100644
--- a/gdb/testsuite/gdb.arch/amd64-prologue-xmm.exp
+++ b/gdb/testsuite/gdb.arch/amd64-prologue-xmm.exp
@@ -15,10 +15,9 @@
 
 # Test GCC PR debug/48827 workaround in GDB.
 
-set testfile "amd64-prologue-xmm"
-set srcfile ${testfile}.s
+standard_testfile .s
+set csrcfile [file rootname $srcfile].c
 set csrcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}.x
 set opts {}
 
 if [info exists COMPILE] {
@@ -30,7 +29,7 @@ if [info exists COMPILE] {
     return 0
 }
 
-if {[prepare_for_testing ${testfile}.exp ${testfile} $srcfile $opts]} {
+if {[prepare_for_testing ${testfile}.exp ${binfile} $srcfile $opts]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.arch/amd64-word.exp b/gdb/testsuite/gdb.arch/amd64-word.exp
index 7009b16..101716d 100644
--- a/gdb/testsuite/gdb.arch/amd64-word.exp
+++ b/gdb/testsuite/gdb.arch/amd64-word.exp
@@ -24,9 +24,7 @@ if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
     return
 }
 
-set testfile "amd64-word"
-set srcfile amd64-pseudo.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile amd64-pseudo.c
 
 if [get_compiler_info] {
     return -1
@@ -37,10 +35,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list
     return
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if ![runto_main] then {
     gdb_suppress_tests
diff --git a/gdb/testsuite/gdb.arch/i386-avx.exp b/gdb/testsuite/gdb.arch/i386-avx.exp
index bbbc6f4..1ee1437 100644
--- a/gdb/testsuite/gdb.arch/i386-avx.exp
+++ b/gdb/testsuite/gdb.arch/i386-avx.exp
@@ -24,9 +24,7 @@ if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } {
     return
 }
 
-set testfile "i386-avx"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
 
 if [get_compiler_info] {
     return -1
@@ -42,10 +40,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list
     return
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if ![runto_main] then {
     gdb_suppress_tests
diff --git a/gdb/testsuite/gdb.arch/i386-byte.exp b/gdb/testsuite/gdb.arch/i386-byte.exp
index 94d0b40..9a0a778 100644
--- a/gdb/testsuite/gdb.arch/i386-byte.exp
+++ b/gdb/testsuite/gdb.arch/i386-byte.exp
@@ -24,9 +24,7 @@ if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"])} then {
     return
 }
 
-set testfile "i386-byte"
-set srcfile i386-pseudo.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile i386-pseudo.c
 
 if [get_compiler_info] {
     return -1
@@ -37,10 +35,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list
     return
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if ![runto_main] then {
     gdb_suppress_tests
diff --git a/gdb/testsuite/gdb.arch/i386-disp-step.exp b/gdb/testsuite/gdb.arch/i386-disp-step.exp
index 8d3d5b8..812902c 100644
--- a/gdb/testsuite/gdb.arch/i386-disp-step.exp
+++ b/gdb/testsuite/gdb.arch/i386-disp-step.exp
@@ -23,9 +23,7 @@ if { ![is_x86_like_target] } then {
     return
 }
 
-set testfile "i386-disp-step"
-set srcfile ${testfile}.S
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .S
 
 set additional_flags "-Wa,-g"
 
diff --git a/gdb/testsuite/gdb.arch/i386-dr3-watch.exp b/gdb/testsuite/gdb.arch/i386-dr3-watch.exp
index 81e33bc..b51c26c 100644
--- a/gdb/testsuite/gdb.arch/i386-dr3-watch.exp
+++ b/gdb/testsuite/gdb.arch/i386-dr3-watch.exp
@@ -23,10 +23,9 @@ if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
     return 0
 }
 
-set testfile "i386-dr3-watch"
-set srcfile ${testfile}.c
+standard_testfile
 
-if [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug $additional_flags}] {
+if [prepare_for_testing ${testfile}.exp ${binfile} ${srcfile} {debug $additional_flags}] {
     untested "failed to compile ${testfile}"
     return -1
 }
diff --git a/gdb/testsuite/gdb.arch/i386-permbkpt.exp b/gdb/testsuite/gdb.arch/i386-permbkpt.exp
index 81ee493..88bfff3 100644
--- a/gdb/testsuite/gdb.arch/i386-permbkpt.exp
+++ b/gdb/testsuite/gdb.arch/i386-permbkpt.exp
@@ -23,9 +23,7 @@ if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
     return
 }
 
-set testfile "i386-permbkpt"
-set srcfile ${testfile}.S
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .S
 
 # some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags]
@@ -35,10 +33,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 gdb_test "break main" "" "First permanent break"
 gdb_test "break main" "" "Second permanent break"
diff --git a/gdb/testsuite/gdb.arch/i386-signal.exp b/gdb/testsuite/gdb.arch/i386-signal.exp
index 987941c..1c0a901 100644
--- a/gdb/testsuite/gdb.arch/i386-signal.exp
+++ b/gdb/testsuite/gdb.arch/i386-signal.exp
@@ -20,9 +20,7 @@ if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
     return
 }
 
-set testfile "i386-signal"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
 	  executable { debug }] != "" } {
diff --git a/gdb/testsuite/gdb.arch/i386-size-overlap.exp b/gdb/testsuite/gdb.arch/i386-size-overlap.exp
index 66ed303..d65ec70 100644
--- a/gdb/testsuite/gdb.arch/i386-size-overlap.exp
+++ b/gdb/testsuite/gdb.arch/i386-size-overlap.exp
@@ -22,9 +22,7 @@ if { ![is_x86_like_target] } then {
     return
 }
 
-set testfile "i386-size-overlap"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 # some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags]
diff --git a/gdb/testsuite/gdb.arch/i386-sse.exp b/gdb/testsuite/gdb.arch/i386-sse.exp
index c62a3a0..773c7ff 100644
--- a/gdb/testsuite/gdb.arch/i386-sse.exp
+++ b/gdb/testsuite/gdb.arch/i386-sse.exp
@@ -24,9 +24,7 @@ if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } {
     return
 }
 
-set testfile "i386-sse"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
 
 if [get_compiler_info] {
     return -1
@@ -42,10 +40,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list
     return
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if ![runto_main] then {
     gdb_suppress_tests
diff --git a/gdb/testsuite/gdb.arch/i386-unwind.exp b/gdb/testsuite/gdb.arch/i386-unwind.exp
index c6c0ee5..d0740db 100644
--- a/gdb/testsuite/gdb.arch/i386-unwind.exp
+++ b/gdb/testsuite/gdb.arch/i386-unwind.exp
@@ -26,9 +26,7 @@ if { ![is_x86_like_target] } then {
     return
 }
 
-set testfile "i386-unwind"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 # some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags]
diff --git a/gdb/testsuite/gdb.arch/i386-word.exp b/gdb/testsuite/gdb.arch/i386-word.exp
index 5ca4159..b19ce40 100644
--- a/gdb/testsuite/gdb.arch/i386-word.exp
+++ b/gdb/testsuite/gdb.arch/i386-word.exp
@@ -24,9 +24,7 @@ if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"])} then {
     return
 }
 
-set testfile "i386-word"
-set srcfile i386-pseudo.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile i386-pseudo.c
 
 if [get_compiler_info] {
     return -1
@@ -37,10 +35,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list
     return
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if ![runto_main] then {
     gdb_suppress_tests
-- 
1.8.1.4

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

* [PATCH 4/5] fix gdb.python to be parallel-safe
  2013-08-13 21:03 [PATCH 0/5] more parallelization fixes Tom Tromey
                   ` (3 preceding siblings ...)
  2013-08-13 21:03 ` [PATCH 3/5] use standard_temp_file in another caching proc Tom Tromey
@ 2013-08-13 21:03 ` Tom Tromey
  2013-08-14  8:33   ` Pedro Alves
  2013-08-14  8:34 ` [PATCH 0/5] more parallelization fixes Pedro Alves
  2013-08-22 13:34 ` Tom Tromey
  6 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2013-08-13 21:03 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This fixes gdb.python to be parallel-safe, mostly by changing it to
use gdb_remote_download.

Tested on x86-64 Fedora 18.

	* gdb.python/py-error.exp: Use gdb_remote_download.
	* gdb.python/py-mi.exp: Use gdb_remote_download.
	* gdb.python/py-objfile-script.exp: Use standard_output_file.
	* gdb.python/py-prettyprint.exp: Use gdb_remote_download.
	(run_lang_tests): Likewise.
	* gdb.python/py-section-script.c: Use SCRIPT_FILE rather than
	filename.
	* gdb.python/py-section-script.exp: Set SCRIPT_FILE when
	compiling.  Use gdb_remote_download.  Update some tests.
	* gdb.python/py-strfns.exp (test_strfns_core_file): Use
	standard_output_file.
	* gdb.python/py-typeprint.exp: Use gdb_remote_download.
	* gdb.python/py-frame-args.exp: Use gdb_remote_download.
	* gdb.python/py-framefilter-mi.exp: Use gdb_remote_download.
	* gdb.python/py-framefilter.exp: Use gdb_remote_download,
	standard_output_file.
---
 gdb/testsuite/gdb.python/py-error.exp          |  3 ++-
 gdb/testsuite/gdb.python/py-frame-args.exp     |  6 ++++--
 gdb/testsuite/gdb.python/py-framefilter-mi.exp |  2 +-
 gdb/testsuite/gdb.python/py-framefilter.exp    | 10 ++++++----
 gdb/testsuite/gdb.python/py-mi.exp             |  2 +-
 gdb/testsuite/gdb.python/py-objfile-script.exp |  4 +++-
 gdb/testsuite/gdb.python/py-prettyprint.exp    | 12 ++++++++----
 gdb/testsuite/gdb.python/py-section-script.c   |  2 +-
 gdb/testsuite/gdb.python/py-section-script.exp | 18 +++++++++++-------
 gdb/testsuite/gdb.python/py-strfns.exp         |  4 ++--
 gdb/testsuite/gdb.python/py-typeprint.exp      |  6 ++++--
 11 files changed, 43 insertions(+), 26 deletions(-)

diff --git a/gdb/testsuite/gdb.python/py-error.exp b/gdb/testsuite/gdb.python/py-error.exp
index a204302..922798d 100644
--- a/gdb/testsuite/gdb.python/py-error.exp
+++ b/gdb/testsuite/gdb.python/py-error.exp
@@ -48,7 +48,8 @@ if {$test2 == ""} {
     return 0
 }
 
-set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py]
+set remote_python_file [gdb_remote_download host \
+			    ${srcdir}/${subdir}/${testfile}.py]
 
 # argc=LookupError: unknown encoding: IBM1047
 gdb_test "source $remote_python_file" "Traceback.*ClassName.*\r\nLookupError: unknown encoding: $charset" $test2
diff --git a/gdb/testsuite/gdb.python/py-frame-args.exp b/gdb/testsuite/gdb.python/py-frame-args.exp
index ff082dd..be6defd 100644
--- a/gdb/testsuite/gdb.python/py-frame-args.exp
+++ b/gdb/testsuite/gdb.python/py-frame-args.exp
@@ -26,9 +26,11 @@ if ![runto_main] {
     return -1
 }
 
-set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py]
+set remote_python_file [gdb_remote_download host \
+			    ${srcdir}/${subdir}/${testfile}.py]
 
-gdb_test_no_output "python exec (open ('${remote_python_file}').read ())"
+gdb_test_no_output "python exec (open ('${remote_python_file}').read ())" \
+    "python exec (open ('[file tail ${remote_python_file}]').read ())"
 
 gdb_breakpoint [gdb_get_line_number "break-here"]
 gdb_continue_to_breakpoint "break-here" ".* break-here .*"
diff --git a/gdb/testsuite/gdb.python/py-framefilter-mi.exp b/gdb/testsuite/gdb.python/py-framefilter-mi.exp
index 54fedf8..8228a91 100644
--- a/gdb/testsuite/gdb.python/py-framefilter-mi.exp
+++ b/gdb/testsuite/gdb.python/py-framefilter-mi.exp
@@ -44,7 +44,7 @@ if {[lsearch -exact [mi_get_features] python] < 0} {
 
 mi_runto main
 
-set remote_python_file [remote_download host ${srcdir}/${subdir}/${pyfile}]
+set remote_python_file [gdb_remote_download host ${srcdir}/${subdir}/${pyfile}]
 
 mi_gdb_test "python execfile ('${remote_python_file}')" ".*\\^done." \
     "Load python file"
diff --git a/gdb/testsuite/gdb.python/py-framefilter.exp b/gdb/testsuite/gdb.python/py-framefilter.exp
index 6c9946b..be5a479 100644
--- a/gdb/testsuite/gdb.python/py-framefilter.exp
+++ b/gdb/testsuite/gdb.python/py-framefilter.exp
@@ -39,7 +39,7 @@ if { [skip_python_tests] } { continue }
 set remote_obj_python_file \
     [remote_download \
 	 host ${srcdir}/${subdir}/${testfile}-gdb.py.in \
-	 ${subdir}/${testfile}-gdb.py]
+	 [standard_output_file ${testfile}-gdb.py]]
 
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_test_no_output "set auto-load safe-path ${remote_obj_python_file}" \
@@ -57,7 +57,8 @@ gdb_test_no_output "set python print-stack full" \
     "Set python print-stack to full"
 
 # Load global frame-filters
-set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py]
+set remote_python_file [gdb_remote_download host \
+			    ${srcdir}/${subdir}/${testfile}.py]
 gdb_test_no_output "python execfile ('${remote_python_file}')" \
     "Load python file"
 
@@ -199,7 +200,7 @@ if { [skip_python_tests] } { continue }
 set remote_obj_python_file \
     [remote_download \
 	 host ${srcdir}/${subdir}/${testfile}-gdb.py.in \
-	 ${subdir}/${testfile}-gdb.py]
+	 [standard_output_file ${testfile}-gdb.py]]
 
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_test_no_output "set auto-load safe-path ${remote_obj_python_file}" \
@@ -218,7 +219,8 @@ gdb_test_no_output "set python print-stack full" \
     "set python print-stack full for no debuginfo tests"
 
 # Load global frame-filters
-set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py]
+set remote_python_file [gdb_remote_download host \
+			    ${srcdir}/${subdir}/${testfile}.py]
 gdb_test_no_output "python execfile ('${remote_python_file}')" \
     "Load python file for no debuginfo tests"
 
diff --git a/gdb/testsuite/gdb.python/py-mi.exp b/gdb/testsuite/gdb.python/py-mi.exp
index ae8bfe5..28aa2c8 100644
--- a/gdb/testsuite/gdb.python/py-mi.exp
+++ b/gdb/testsuite/gdb.python/py-mi.exp
@@ -42,7 +42,7 @@ if {[lsearch -exact [mi_get_features] python] < 0} {
 
 mi_runto main
 
-set remote_python_file [remote_download host ${srcdir}/${subdir}/${pyfile}]
+set remote_python_file [gdb_remote_download host ${srcdir}/${subdir}/${pyfile}]
 
 mi_gdb_test "python exec (open ('${remote_python_file}').read ())" ""
 
diff --git a/gdb/testsuite/gdb.python/py-objfile-script.exp b/gdb/testsuite/gdb.python/py-objfile-script.exp
index 097de49..f75b9ba 100644
--- a/gdb/testsuite/gdb.python/py-objfile-script.exp
+++ b/gdb/testsuite/gdb.python/py-objfile-script.exp
@@ -32,7 +32,9 @@ if { [skip_python_tests] } { continue }
 # Make the -gdb.py script available to gdb, it is automagically loaded by gdb.
 # Care is taken to put it in the same directory as the binary so that
 # gdb will find it.
-set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}-gdb.py.in ${subdir}/${testfile}-gdb.py]
+set remote_python_file [remote_download host \
+			    ${srcdir}/${subdir}/${testfile}-gdb.py.in \
+			    [standard_output_file ${testfile}-gdb.py]]
 
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_test_no_output "set auto-load safe-path ${remote_python_file}" "set auto-load safe-path"
diff --git a/gdb/testsuite/gdb.python/py-prettyprint.exp b/gdb/testsuite/gdb.python/py-prettyprint.exp
index b7dd5b7..d124a72 100644
--- a/gdb/testsuite/gdb.python/py-prettyprint.exp
+++ b/gdb/testsuite/gdb.python/py-prettyprint.exp
@@ -53,9 +53,11 @@ proc run_lang_tests {exefile lang} {
 	".*Breakpoint.*"
     gdb_test "continue" ".*Breakpoint.*"
 
-    set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py]
+    set remote_python_file [gdb_remote_download host \
+				${srcdir}/${subdir}/${testfile}.py]
 
-    gdb_test_no_output "python exec (open ('${remote_python_file}').read ())"
+    gdb_test_no_output "python exec (open ('${remote_python_file}').read ())" \
+	"python exec (open ('[file tail ${remote_python_file}]').read ())"
     
     gdb_test "print ss" " = a=< a=<1> b=<$hex>> b=< a=<2> b=<$hex>>"
     gdb_test "print ssa\[1\]" " = a=< a=<5> b=<$hex>> b=< a=<6> b=<$hex>>"
@@ -123,9 +125,11 @@ if ![runto_main ] then {
     return
 }
 
-set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py]
+set remote_python_file [gdb_remote_download host \
+			    ${srcdir}/${subdir}/${testfile}.py]
 
-gdb_test_no_output "python exec (open ('${remote_python_file}').read ())"
+gdb_test_no_output "python exec (open ('${remote_python_file}').read ())" \
+    "python exec (open ('[file tail ${remote_python_file}]').read ())"
 
 gdb_breakpoint [gdb_get_line_number "eval-break"]
 gdb_continue_to_breakpoint "eval-break" ".* eval-break .*"
diff --git a/gdb/testsuite/gdb.python/py-section-script.c b/gdb/testsuite/gdb.python/py-section-script.c
index ebe7b9b..db1daea 100644
--- a/gdb/testsuite/gdb.python/py-section-script.c
+++ b/gdb/testsuite/gdb.python/py-section-script.c
@@ -26,7 +26,7 @@
 .popsection \n\
 ");
 
-DEFINE_GDB_SCRIPT ("py-section-script.py")
+DEFINE_GDB_SCRIPT (SCRIPT_FILE)
 
 struct ss
 {
diff --git a/gdb/testsuite/gdb.python/py-section-script.exp b/gdb/testsuite/gdb.python/py-section-script.exp
index 7f710d3..66f1117 100644
--- a/gdb/testsuite/gdb.python/py-section-script.exp
+++ b/gdb/testsuite/gdb.python/py-section-script.exp
@@ -31,7 +31,15 @@ if {![istarget *-*-linux*]
 
 standard_testfile
 
-if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
+# Make this available to gdb before the program starts, it is
+# automagically loaded by gdb.
+set remote_python_file [gdb_remote_download host \
+			    ${srcdir}/${subdir}/${testfile}.py]
+
+set quoted_name "\"$remote_python_file\""
+
+if {[build_executable $testfile.exp $testfile $srcfile \
+	 [list debug additional_flags=-DSCRIPT_FILE=$quoted_name]] == -1} {
     return -1
 }
 
@@ -42,18 +50,14 @@ gdb_start
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-# Make this available to gdb before the program starts, it is
-# automagically loaded by gdb.
-set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py]
-
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_test_no_output "set auto-load safe-path ${remote_python_file}" "set auto-load safe-path"
 gdb_load ${binfile}
 
 # Verify gdb loaded the script.
-gdb_test "info auto-load python-scripts" "Yes.*${testfile}.py.*full name: .*/${testfile}.py.*"
+gdb_test "info auto-load python-scripts" "Yes.*${testfile}.py.*"
 # Again, with a regexp this time.
-gdb_test "info auto-load python-scripts ${testfile}" "Yes.*${testfile}.py.*full name: .*/${testfile}.py.*"
+gdb_test "info auto-load python-scripts ${testfile}" "Yes.*${testfile}.py.*"
 # Again, with a regexp that matches no scripts.
 gdb_test "info auto-load python-scripts no-script-matches-this" \
   "No auto-load scripts matching no-script-matches-this."
diff --git a/gdb/testsuite/gdb.python/py-strfns.exp b/gdb/testsuite/gdb.python/py-strfns.exp
index 9d78518..daeb852 100644
--- a/gdb/testsuite/gdb.python/py-strfns.exp
+++ b/gdb/testsuite/gdb.python/py-strfns.exp
@@ -64,9 +64,9 @@ gdb_test "p /d {char\[4\]} arg" "= \\{0, 1, 2, 4\\}"
 # Verify use on a core file.
 
 proc test_strfns_core_file { } {
-    global objdir subdir gdb_prompt testfile
+    global gdb_prompt testfile
 
-    set filename "${objdir}/${subdir}/py-strfns.core"
+    set filename [standard_output_file py-strfns.core]
 
     if {![gdb_gcore_cmd "$filename" "save a corefile"]} {
 	# No use proceeding from here.
diff --git a/gdb/testsuite/gdb.python/py-typeprint.exp b/gdb/testsuite/gdb.python/py-typeprint.exp
index 5e2a238..8e1b379 100644
--- a/gdb/testsuite/gdb.python/py-typeprint.exp
+++ b/gdb/testsuite/gdb.python/py-typeprint.exp
@@ -26,9 +26,11 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
 
 if { [skip_python_tests] } { continue }
 
-set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py]
+set remote_python_file [gdb_remote_download host \
+			    ${srcdir}/${subdir}/${testfile}.py]
 
-gdb_test_no_output "python exec (open ('${remote_python_file}').read ())"
+gdb_test_no_output "python exec (open ('${remote_python_file}').read ())" \
+    "python exec (open ('[file tail ${remote_python_file}]').read ())"
 
 cp_test_ptype_class s "basic test" "class" "templ<string>" {
     { field public "T x;" }
-- 
1.8.1.4

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

* Re: [PATCH 4/5] fix gdb.python to be parallel-safe
  2013-08-13 21:03 ` [PATCH 4/5] fix gdb.python to be parallel-safe Tom Tromey
@ 2013-08-14  8:33   ` Pedro Alves
  2013-08-14 16:20     ` Tom Tromey
  0 siblings, 1 reply; 16+ messages in thread
From: Pedro Alves @ 2013-08-14  8:33 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 08/13/2013 10:03 PM, Tom Tromey wrote:

>  # Verify gdb loaded the script.
> -gdb_test "info auto-load python-scripts" "Yes.*${testfile}.py.*full name: .*/${testfile}.py.*"
> +gdb_test "info auto-load python-scripts" "Yes.*${testfile}.py.*"
>  # Again, with a regexp this time.
> -gdb_test "info auto-load python-scripts ${testfile}" "Yes.*${testfile}.py.*full name: .*/${testfile}.py.*"
> +gdb_test "info auto-load python-scripts ${testfile}" "Yes.*${testfile}.py.*"
>  # Again, with a regexp that matches no scripts.

Curious.  Did the "full name:" bit disappear from the output?

-- 
Pedro Alves

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

* Re: [PATCH 5/5] fix gdb.arch to be parallel-safe
  2013-08-13 21:03 ` [PATCH 5/5] fix gdb.arch to be parallel-safe Tom Tromey
@ 2013-08-14  8:33   ` Pedro Alves
  2013-08-14 17:12     ` Tom Tromey
  0 siblings, 1 reply; 16+ messages in thread
From: Pedro Alves @ 2013-08-14  8:33 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 08/13/2013 10:03 PM, Tom Tromey wrote:
> This fixes parts of gdb.arch to be parallel-safe.
> I only changed the bits I could test on this machine.
> 
> I don't have access to many of the machines needed to fully switch
> gdb.arch; but I am happy to provide advice to others attempting this.
> Or, I can send an untested patch to convert it all.

If you're willing, the latter would be better, IMO.  Best would be
publish a git branch and give a week or two for people to test.
My reasoning is that otherwise, we'll just end up with yet another
partial conversion.  If some port goes untested, and the patch
breaks something in the testsuite for that port, then whoever cares for
the platform should notice it when she next runs tests on the platform.
If nobody cares for the platform, and doesn't run tests, well, then
it's okay to break it, as nobody cares...

-- 
Pedro Alves

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

* Re: [PATCH 0/5] more parallelization fixes
  2013-08-13 21:03 [PATCH 0/5] more parallelization fixes Tom Tromey
                   ` (4 preceding siblings ...)
  2013-08-13 21:03 ` [PATCH 4/5] fix gdb.python to be parallel-safe Tom Tromey
@ 2013-08-14  8:34 ` Pedro Alves
  2013-08-22 13:34 ` Tom Tromey
  6 siblings, 0 replies; 16+ messages in thread
From: Pedro Alves @ 2013-08-14  8:34 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 08/13/2013 10:03 PM, Tom Tromey wrote:
> This series updates more parts of the test suite to be parallel-safe.
> I think the patches are all reasonably straightforward.

Sent a couple comments, but looked overall fine to me.  Thanks!

-- 
Pedro Alves

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

* Re: [PATCH 4/5] fix gdb.python to be parallel-safe
  2013-08-14  8:33   ` Pedro Alves
@ 2013-08-14 16:20     ` Tom Tromey
  0 siblings, 0 replies; 16+ messages in thread
From: Tom Tromey @ 2013-08-14 16:20 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

>> # Verify gdb loaded the script.
>> -gdb_test "info auto-load python-scripts" "Yes.*${testfile}.py.*full
>> name: .*/${testfile}.py.*"
>> +gdb_test "info auto-load python-scripts" "Yes.*${testfile}.py.*"
>> # Again, with a regexp this time.
>> -gdb_test "info auto-load python-scripts ${testfile}"
>> "Yes.*${testfile}.py.*full name: .*/${testfile}.py.*"
>> +gdb_test "info auto-load python-scripts ${testfile}" "Yes.*${testfile}.py.*"
>> # Again, with a regexp that matches no scripts.

Pedro> Curious.  Did the "full name:" bit disappear from the output?

Yes, because now the scripts are found by their full name.
I don't think it is especially relevant to the test.

Tom

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

* Re: [PATCH 5/5] fix gdb.arch to be parallel-safe
  2013-08-14  8:33   ` Pedro Alves
@ 2013-08-14 17:12     ` Tom Tromey
  0 siblings, 0 replies; 16+ messages in thread
From: Tom Tromey @ 2013-08-14 17:12 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

>> I don't have access to many of the machines needed to fully switch
>> gdb.arch; but I am happy to provide advice to others attempting this.
>> Or, I can send an untested patch to convert it all.

Pedro> If you're willing, the latter would be better, IMO.  Best would be
Pedro> publish a git branch and give a week or two for people to test.

It's all already in archer.git on tromey/fully-parallelize-test-suite,
albeit in an unpolished form.

If you check that out, just run the gdb.arch tests.
Other parts of that branch are wrong, so I wouldn't bother running
anything else.

Tom

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

* Re: [PATCH 0/5] more parallelization fixes
  2013-08-13 21:03 [PATCH 0/5] more parallelization fixes Tom Tromey
                   ` (5 preceding siblings ...)
  2013-08-14  8:34 ` [PATCH 0/5] more parallelization fixes Pedro Alves
@ 2013-08-22 13:34 ` Tom Tromey
  6 siblings, 0 replies; 16+ messages in thread
From: Tom Tromey @ 2013-08-22 13:34 UTC (permalink / raw)
  To: gdb-patches

>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:

Tom> This series updates more parts of the test suite to be parallel-safe.
Tom> I think the patches are all reasonably straightforward.

I'm putting this series in now.

Tom

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

* Re: [PATCH 2/5] introduce gdb_remote_download and finish parallel fixes in gdb.dwarf2
  2013-08-13 21:03 ` [PATCH 2/5] introduce gdb_remote_download and finish parallel fixes in gdb.dwarf2 Tom Tromey
@ 2013-08-26  2:20   ` Yao Qi
  2013-08-26 15:54     ` Tom Tromey
  0 siblings, 1 reply; 16+ messages in thread
From: Yao Qi @ 2013-08-26  2:20 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 08/14/2013 05:03 AM, Tom Tromey wrote:
> +# 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]
> +}
> +

Tom,
this change causes regressions in remote-host testing....

(gdb) python exec (open ('').read ())^M
Traceback (most recent call last):^M
  File "<string>", line 1, in <module>^M
IOError: [Errno 22] invalid mode ('r') or filename: ''^M
Error while executing Python code.^M
(gdb) FAIL: gdb.python/py-typeprint.exp: python exec (open ('').read ())

The proc gdb_remote_download is invoked like this:

  gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py

the tofile is "".  Then, remote_donwload is invoke like like

  remote_download host ${srcdir}/${subdir}/${testfile}.py ""

In remote_download,

proc remote_download { dest file args } {
    if { [llength $args] > 0 } {
        set destfile [lindex $args 0]
    } else {
        set destfile [file tail $file]
    }

ARGS length is 1 and destfile is set to "", which is wrong.  How about
the patch below?

-- 
Yao (齐尧)

gdb/testsuite:

2013-08-26  Yao Qi  <yao@codesourcery.com>

	* lib/gdb.exp (gdb_remote_download): Don't pass $tofile to
	remote_download if it is empty.
---
 gdb/testsuite/lib/gdb.exp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 5456029..fabfa69 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3301,7 +3301,12 @@ 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]
+
+    if { $tofile == "" } {
+	return [remote_download $dest $fromfile]
+    } else {
+	return [remote_download $dest $fromfile $tofile]
+    }
 }
 
 # gdb_download
-- 
1.7.7.6

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

* Re: [PATCH 2/5] introduce gdb_remote_download and finish parallel fixes in gdb.dwarf2
  2013-08-26  2:20   ` Yao Qi
@ 2013-08-26 15:54     ` Tom Tromey
  2013-08-27  0:20       ` Yao Qi
  0 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2013-08-26 15:54 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:

Yao> ARGS length is 1 and destfile is set to "", which is wrong.  How about
Yao> the patch below?

Oops, I'm very sorry about that.

Yao> 2013-08-26  Yao Qi  <yao@codesourcery.com>
Yao> 	* lib/gdb.exp (gdb_remote_download): Don't pass $tofile to
Yao> 	remote_download if it is empty.

Looks reasonable to me.  Thank you.

Tom

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

* Re: [PATCH 2/5] introduce gdb_remote_download and finish parallel fixes in gdb.dwarf2
  2013-08-26 15:54     ` Tom Tromey
@ 2013-08-27  0:20       ` Yao Qi
  0 siblings, 0 replies; 16+ messages in thread
From: Yao Qi @ 2013-08-27  0:20 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 08/26/2013 11:54 PM, Tom Tromey wrote:
> Yao> 2013-08-26  Yao Qi<yao@codesourcery.com>
> Yao> 	* lib/gdb.exp (gdb_remote_download): Don't pass $tofile to
> Yao> 	remote_download if it is empty.
>
> Looks reasonable to me.  Thank you.

Thanks for the review.  Patch is committed.  The result of remote host
testing to mingw native gdb becomes normal again.

-- 
Yao (齐尧)

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

* Testsuite regression for fission + gdbindex run  [Re: [PATCH 1/5] fix some gdb.dwarf2 tests for parallel safety]
  2013-08-13 21:03 ` [PATCH 1/5] fix some gdb.dwarf2 tests for parallel safety Tom Tromey
@ 2013-08-27 15:16   ` Jan Kratochvil
  0 siblings, 0 replies; 16+ messages in thread
From: Jan Kratochvil @ 2013-08-27 15:16 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On Tue, 13 Aug 2013 23:03:19 +0200, Tom Tromey wrote:
> This fixes a few gdb.dwarf2 tests to be more parallel-safe.  This
> mostly amounts to changing them to write their files into the
> directory designated by standard_output_file.
> 
> Built and regtested on x86-64 Fedora 18.
> 
> 	* gdb.dwarf2/clztest.exp: Use standard_testfile.
> 	* gdb.dwarf2/dw2-minsym-in-cu.exp: Use standard_testfile.
> 	* gdb.dwarf2/fission-base.S: Remove directory from
> 	DW_AT_GNU_dwo_name.
> 	* gdb.dwarf2/fission-base.exp: Use build_executable.  Set
> 	debug-file-directory.
> 	* gdb.dwarf2/fission-reread.S: Remove directory from
> 	DW_AT_GNU_dwo_name.
> 	* gdb.dwarf2/fission-reread.exp: Use build_executable.  Set
> 	debug-file-directory.

c18a2996a254ec0f05b3bc4c8b2800641fe26682 is the first bad commit
commit c18a2996a254ec0f05b3bc4c8b2800641fe26682
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Aug 22 13:39:12 2013 +0000
    fix some gdb.dwarf2 tests for parallel safety

I get these PASS->UNTESTED regressions in gdbindex mode:

runtest CC_FOR_TARGET=/bin/sh\ $PWD/../contrib/cc-with-tweaks.sh\ -i\ gcc CXX_FOR_TARGET=/bin/sh\ $PWD/../contrib/cc-with-tweaks.sh\ -i\ g++ gdb.dwarf2/fission-base.exp gdb.dwarf2/fission-reread.exp

+gdb compile failed, warning: Could not find DWO CU fission-base(0x0) referenced by CU at offset 0x0 [in module
/unsafegdb/testsuite.unix.-m64/gdb.dwarf2/fission-base]
+UNTESTED: gdb.dwarf2/fission-base.exp: fission-base.exp

+gdb compile failed, warning: Could not find DWO TU fission-reread(0x9022f1ceac7e8b19) referenced by TU at offset 0x0 [in module /unsafegdb/testsuite.unix.-m64/gdb.dwarf2/fission-reread]
+warning: Could not find DWO TU fission-reread(0x9022f1ceac7e8b19) referenced by TU at offset 0x0 [in module /unsafegdb/testsuite.unix.-m64/gdb.dwarf2/fission-reread]
+gdb/contrib/cc-with-tweaks.sh: line 170:  5203 Aborted                 (core dumped) $GDB --batch-silent -nx -ex "set auto-load no" -ex "file $output_file" -ex "save gdb-index $output_dir"
+UNTESTED: gdb.dwarf2/fission-reread.exp: fission-reread.exp


Thanks,
Jan

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

end of thread, other threads:[~2013-08-27 15:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-13 21:03 [PATCH 0/5] more parallelization fixes Tom Tromey
2013-08-13 21:03 ` [PATCH 5/5] fix gdb.arch to be parallel-safe Tom Tromey
2013-08-14  8:33   ` Pedro Alves
2013-08-14 17:12     ` Tom Tromey
2013-08-13 21:03 ` [PATCH 2/5] introduce gdb_remote_download and finish parallel fixes in gdb.dwarf2 Tom Tromey
2013-08-26  2:20   ` Yao Qi
2013-08-26 15:54     ` Tom Tromey
2013-08-27  0:20       ` Yao Qi
2013-08-13 21:03 ` [PATCH 1/5] fix some gdb.dwarf2 tests for parallel safety Tom Tromey
2013-08-27 15:16   ` Testsuite regression for fission + gdbindex run [Re: [PATCH 1/5] fix some gdb.dwarf2 tests for parallel safety] Jan Kratochvil
2013-08-13 21:03 ` [PATCH 3/5] use standard_temp_file in another caching proc Tom Tromey
2013-08-13 21:03 ` [PATCH 4/5] fix gdb.python to be parallel-safe Tom Tromey
2013-08-14  8:33   ` Pedro Alves
2013-08-14 16:20     ` Tom Tromey
2013-08-14  8:34 ` [PATCH 0/5] more parallelization fixes Pedro Alves
2013-08-22 13:34 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).