fix gdb.arch to be parallel-safe
authorTom Tromey <tromey@redhat.com>
Thu, 22 Aug 2013 13:54:15 +0000 (13:54 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 22 Aug 2013 13:54:15 +0000 (13:54 +0000)
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.

18 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/amd64-byte.exp
gdb/testsuite/gdb.arch/amd64-disp-step.exp
gdb/testsuite/gdb.arch/amd64-dword.exp
gdb/testsuite/gdb.arch/amd64-entry-value-param.exp
gdb/testsuite/gdb.arch/amd64-entry-value.exp
gdb/testsuite/gdb.arch/amd64-prologue-xmm.exp
gdb/testsuite/gdb.arch/amd64-word.exp
gdb/testsuite/gdb.arch/i386-avx.exp
gdb/testsuite/gdb.arch/i386-byte.exp
gdb/testsuite/gdb.arch/i386-disp-step.exp
gdb/testsuite/gdb.arch/i386-dr3-watch.exp
gdb/testsuite/gdb.arch/i386-permbkpt.exp
gdb/testsuite/gdb.arch/i386-signal.exp
gdb/testsuite/gdb.arch/i386-size-overlap.exp
gdb/testsuite/gdb.arch/i386-sse.exp
gdb/testsuite/gdb.arch/i386-unwind.exp
gdb/testsuite/gdb.arch/i386-word.exp

index 59fcf90e767ffc8f43d170f04c64f4ff2d0972df..fa1b3214c751348500b9086c6241cfcb02e4799b 100644 (file)
@@ -1,3 +1,26 @@
+2013-08-22  Tom Tromey  <tromey@redhat.com>
+
+       * 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.
+
 2013-08-22  Tom Tromey  <tromey@redhat.com>
 
        * gdb.python/py-error.exp: Use gdb_remote_download.
index 0b908fa41ee1244325cc31e8a10fff1ad0bf304f..c4774e6516bff41f6936c32d557d4dee48d15d70 100644 (file)
@@ -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
index 14a65d33ad181d3510879f5cc20c35cd2d9278c3..1ad39cc6bd86b576d80239b74a8792eab6d3eed8 100644 (file)
@@ -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"
 
index 7b5cab75409fe01c2926ddb3e6de7fcc628a7afd..759cd0e56aef23d313a27f94ebdd43cf8ca37c9d 100644 (file)
@@ -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
index 4197ed8c41269313d0f983356534f90425544080..e44b6ff8b7f8ed5651be27fe2eb1963e2c8142e0 100644 (file)
 # 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 .*"
index df6cb270d76487c1397e2f6a14047757f32b6b29..2393a717f31479c0e218da79502471b3b95733c1 100644 (file)
@@ -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] {
index 28ad9b4898372e09358d7294e0b5cf761a27c973..6fafa26fee273f714a521fb52371f4e903ba7ceb 100644 (file)
 
 # 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
 }
 
index 7009b165a0185bd1403f5143584c24ab99d1d4fa..101716de7c622b4485dcdc994c6d34b5c9d83891 100644 (file)
@@ -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
index bbbc6f4ed4f98652027fcd326927b6a8b608d610..1ee14378d95caa33393b5208bc911f822ff089af 100644 (file)
@@ -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
index 94d0b40b0cab52ada80fc599503ab5c06b92fc35..9a0a778a320aae280e7ac7077e9f5f85a6378c63 100644 (file)
@@ -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
index 8d3d5b85a35af5abf81f4c7ce02ae2f395bdf396..812902c06116377644fde3506ee739da76fd776a 100644 (file)
@@ -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"
 
index 81e33bc0e7f808167190cced175d72b5e759cbd8..b51c26c836ce670df796aab3168d584f0ab8ed7b 100644 (file)
@@ -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
 }
index 81ee4932b29c25ad420a05b90eee811a6610d7b1..88bfff343a8f782a412f6031a13894712643c8e9 100644 (file)
@@ -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"
index 987941c8ba876185b75a8fe6687f6352cc7b1aa9..1c0a901323b2298c0f83983dffae0b8190c954cd 100644 (file)
@@ -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 }] != "" } {
index 66ed3039db58edd0b807fd42fdaa028f9dd06c9f..d65ec702287be885bedf06a5e67a2dc7fdc6fe96 100644 (file)
@@ -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]
index c62a3a0b86e003daa040143c156ec2d0ccecb4c3..773c7ff9777d5305c74c0c7fdc70a76c55fc23dc 100644 (file)
@@ -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
index c6c0ee5fa0dc4e79a828de9d19860fbecc73546f..d0740db0a63d0824f38a595384ca7985aeaf08c9 100644 (file)
@@ -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]
index 5ca4159330431ac37bf2eeb2fe450ddab5072f7e..b19ce4002ed2a09ab6f8fe3d635c21880627ab6e 100644 (file)
@@ -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
This page took 0.073598 seconds and 4 git commands to generate.