gdb/testsuite/
authorYao Qi <yao@codesourcery.com>
Tue, 8 Nov 2011 08:23:49 +0000 (08:23 +0000)
committerYao Qi <yao@codesourcery.com>
Tue, 8 Nov 2011 08:23:49 +0000 (08:23 +0000)
* gdb.exp (supports_process_record): New.
(supports_reverse): New.
* gdb.reverse/break-precsave.exp: Call support_process_record
to run test conditionally.
* gdb.reverse/consecutive-precsave.exp: Likewise.
* gdb.reverse/i386-precsave.exp: Likewise.
* gdb.reverse/machinestate-precsave.exp: Likewise.
* gdb.reverse/solib-precsave.exp: Likewise.
* gdb.reverse/step-precsave.exp: Likewise.
* gdb.reverse/until-precsave.exp: Likewise.
* gdb.reverse/watch-precsave.exp: Likewise.
* gdb.reverse/break-reverse.exp: Call support_reverse  to run
test conditionally.
* gdb.reverse/consecutive-reverse.exp: Likewise.
* gdb.reverse/finish-precsave.exp: Likewise.
* gdb.reverse/finish-reverse-bkpt.exp: Likewise.
* gdb.reverse/finish-reverse.exp: Likewise.
* gdb.reverse/i386-reverse.exp: Likewise.
* gdb.reverse/i386-sse-reverse.exp: Likewise.
* gdb.reverse/machinestate.exp: Likewise.
* gdb.reverse/next-reverse-bkpt-over-sr.exp: Likewise.
* gdb.reverse/sigall-precsave.exp: Likewise.
* gdb.reverse/sigall-reverse.exp: Likewise.
* gdb.reverse/solib-reverse.exp: Likewise.
* gdb.reverse/step-reverse.exp: Likewise.
* gdb.reverse/until-reverse.exp: Likewise.
* gdb.reverse/watch-reverse.exp: Likewise.

25 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.reverse/break-precsave.exp
gdb/testsuite/gdb.reverse/break-reverse.exp
gdb/testsuite/gdb.reverse/consecutive-precsave.exp
gdb/testsuite/gdb.reverse/consecutive-reverse.exp
gdb/testsuite/gdb.reverse/finish-precsave.exp
gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
gdb/testsuite/gdb.reverse/finish-reverse.exp
gdb/testsuite/gdb.reverse/i386-precsave.exp
gdb/testsuite/gdb.reverse/i386-reverse.exp
gdb/testsuite/gdb.reverse/i386-sse-reverse.exp
gdb/testsuite/gdb.reverse/machinestate-precsave.exp
gdb/testsuite/gdb.reverse/machinestate.exp
gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
gdb/testsuite/gdb.reverse/sigall-precsave.exp
gdb/testsuite/gdb.reverse/sigall-reverse.exp
gdb/testsuite/gdb.reverse/solib-precsave.exp
gdb/testsuite/gdb.reverse/solib-reverse.exp
gdb/testsuite/gdb.reverse/step-precsave.exp
gdb/testsuite/gdb.reverse/step-reverse.exp
gdb/testsuite/gdb.reverse/until-precsave.exp
gdb/testsuite/gdb.reverse/until-reverse.exp
gdb/testsuite/gdb.reverse/watch-precsave.exp
gdb/testsuite/gdb.reverse/watch-reverse.exp
gdb/testsuite/lib/gdb.exp

index a98cb082af55ee82ea7c045cfb025126c30761c8..8faa846ef1e4d53b02e7f0ea24fbfca63375a5ef 100644 (file)
@@ -1,3 +1,33 @@
+2011-11-08  Yao Qi  <yao@codesourcery.com>
+
+       * gdb.exp (supports_process_record): New.
+       (supports_reverse): New.
+       * gdb.reverse/break-precsave.exp: Call support_process_record
+       to run test conditionally.
+       * gdb.reverse/consecutive-precsave.exp: Likewise.
+       * gdb.reverse/i386-precsave.exp: Likewise.
+       * gdb.reverse/machinestate-precsave.exp: Likewise.
+       * gdb.reverse/solib-precsave.exp: Likewise.
+       * gdb.reverse/step-precsave.exp: Likewise.
+       * gdb.reverse/until-precsave.exp: Likewise.
+       * gdb.reverse/watch-precsave.exp: Likewise.
+       * gdb.reverse/break-reverse.exp: Call support_reverse  to run
+       test conditionally.
+       * gdb.reverse/consecutive-reverse.exp: Likewise.
+       * gdb.reverse/finish-precsave.exp: Likewise.
+       * gdb.reverse/finish-reverse-bkpt.exp: Likewise.
+       * gdb.reverse/finish-reverse.exp: Likewise.
+       * gdb.reverse/i386-reverse.exp: Likewise.
+       * gdb.reverse/i386-sse-reverse.exp: Likewise.
+       * gdb.reverse/machinestate.exp: Likewise.
+       * gdb.reverse/next-reverse-bkpt-over-sr.exp: Likewise.
+       * gdb.reverse/sigall-precsave.exp: Likewise.
+       * gdb.reverse/sigall-reverse.exp: Likewise.
+       * gdb.reverse/solib-reverse.exp: Likewise.
+       * gdb.reverse/step-reverse.exp: Likewise.
+       * gdb.reverse/until-reverse.exp: Likewise.
+       * gdb.reverse/watch-reverse.exp: Likewise.
+
 2011-11-05  Yao Qi  <yao@codesourcery.com>
 
        * gdb.trace/trace-break.exp: Add test on setting two
index c7e492bbe0407988627bccddf4a21b961cc92f8a..dc035c06ac43e1b34474d0fb128dbda8ca552d65 100644 (file)
@@ -17,7 +17,7 @@
 # with breakpoints in a process record logfile.
 
 # This test suitable only for process record-replay
-if ![target_info exists gdb,use_precord] {
+if ![supports_process_record] {
     return
 }
 
@@ -35,7 +35,7 @@ set end_location  [gdb_get_line_number "end of main"  ]
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index fd77bc51001dc8fd76c08ee06be8d549d5fe31df..d76a0e6dd98dd66640a8f1d1900abcd56dfe7187 100644 (file)
@@ -16,7 +16,7 @@
 # This file is part of the GDB testsuite.  It tests reverse debugging
 # with breakpoints.
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
@@ -34,7 +34,7 @@ set end_location  [gdb_get_line_number "end of main"  ]
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index 86923f623e877152f2752f7deeb474a2f43047d3..68d6f83b023d9af768c2554199571c03eb5ee3d8 100644 (file)
@@ -17,7 +17,7 @@
 # consecutive instructions in a process record logfile.
 
 # This test suitable only for process record-replay
-if ![target_info exists gdb,use_precord] {
+if ![supports_process_record] {
     return
 }
 
@@ -30,7 +30,7 @@ if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index 967236f927a03335f786ecc83e77889cdbfaa117..7027729344fe0a147e2f3ca7dc894d40399c52cd 100644 (file)
@@ -16,7 +16,7 @@
 # This file is part of the GDB testsuite.  It tests stepping over
 # consecutive instructions in reverse.
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
@@ -29,7 +29,7 @@ if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index fbf35b63bfdbd7811eeab7297ae1b9c4da37ecac..7ba7b88fde0ed5ab08a87387ae2b751344322014 100644 (file)
@@ -16,7 +16,7 @@
 # This file is part of the GDB testsuite.  It tests 'finish' with
 # reverse debugging.
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
@@ -29,7 +29,7 @@ if { [prepare_for_testing $testfile.exp "$testfile" $srcfile] } {
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index 09f68372c272616966b26da34365f9211362bca1..4a8990a6c70d9acef5c9bac6541815d0bda0d6c3 100644 (file)
@@ -19,7 +19,7 @@
 # the functions entry would be ignored.  Make sure the bug doesn't
 # reappear.
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
@@ -35,7 +35,7 @@ if ![runto_main] then {
     return 0
 }
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index e6be15874982313176bd5988ab70889cb8beca36..0708b37d56c54173734e3732f38c30a9356412c2 100644 (file)
@@ -16,7 +16,7 @@
 # This file is part of the GDB testsuite.  It tests 'finish' with
 # reverse debugging.
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
@@ -29,7 +29,7 @@ if { [prepare_for_testing $testfile.exp "$testfile" $srcfile] } {
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index 10d8ba3c4a8feb4926089a758c3cd43babfa8ec0..e82dc90ccbc0935374d6ba8f3da2772fa9c2a450 100644 (file)
@@ -20,7 +20,7 @@
 #
 
 # This test suitable only for process record-replay
-if ![target_info exists gdb,use_precord] {
+if ![supports_process_record] {
     return
 }
 
@@ -57,7 +57,7 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index f9fda5ee47730ea0b36ec5c4b97d3d5e67deb397..0d7e57a5854d3eaa734fde58fcf8887d19e32346 100644 (file)
@@ -19,7 +19,7 @@
 # This test tests some i386 general instructions for reverse execution.
 #
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
@@ -56,7 +56,7 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index 3e7664342bcbd088b71d46bb57f832db731a6cc1..2641b3a2b178210de22119bc322751bae69c1983 100644 (file)
@@ -19,7 +19,7 @@
 # This test tests some i386 general instructions for reverse execution.
 #
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
@@ -57,7 +57,7 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index a2f2515aefe642d9f7bc9831d01ca9c71a1a5ff7..adc58dab51db92aa34cec4523f6a94109b544f8b 100644 (file)
@@ -36,7 +36,7 @@
 #
 
 # This test suitable only for process record-replay
-if ![target_info exists gdb,use_precord] {
+if ![supports_process_record] {
     return
 }
 
@@ -57,7 +57,7 @@ set endmain   [gdb_get_line_number " end main "   $srcfile]
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index bc2516e09a727d20a33c89c2302731fa24f1fd12..d51a4a3a16771a5592808fc002e289d1346acc50 100644 (file)
@@ -35,7 +35,7 @@
 #   Test forward replay
 #
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
@@ -56,7 +56,7 @@ set endmain   [gdb_get_line_number " end main "   $srcfile]
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index 9a95dca1cedc665d51a4a303aa950aa71b419717..187eb24c7606faebfd82ad51c5550589cb387f80 100644 (file)
@@ -23,7 +23,7 @@
 # the same location as the step-resume breakpoint isn't ignored.
 #
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
@@ -39,7 +39,7 @@ if ![runto_main] then {
     return 0
 }
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index 94144d33ee103a93d4842ed282a0e6e64ada93c9..a8c4184239a9ab131a75e7e12e15dbf18ce11aa5 100644 (file)
@@ -18,7 +18,7 @@ if [target_info exists gdb,nosignals] {
     return
 }
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
@@ -172,7 +172,7 @@ gdb_load $binfile
 
 runto gen_ABRT
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index d152965bb50b907ecda03044b47acdc9fc511104..f4bd0854cf383cdef5d8c8e8f0ce327388de14ba 100644 (file)
@@ -18,7 +18,7 @@ if [target_info exists gdb,nosignals] {
     return
 }
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
@@ -172,7 +172,7 @@ gdb_load $binfile
 
 runto gen_ABRT
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index be6502fe3e29ab94028b09398f2b337bbb90f267..71b9ce3a94657acd2cbe2245be02e5e987af2b77 100644 (file)
@@ -17,7 +17,7 @@
 # with shared libraries and a logfile.
 
 # This test suitable only for process record-replay
-if ![target_info exists gdb,use_precord] {
+if ![supports_process_record] {
     return
 }
 
@@ -54,7 +54,7 @@ gdb_load ${binfile}
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index 1a516051c19fb23ed3ce73a492787a38cd3910c6..f57616cb67ae606c3d4f314b0b98d25d76ac8ed0 100644 (file)
@@ -16,7 +16,7 @@
 # This file is part of the GDB testsuite.  It tests reverse debugging
 # with shared libraries.
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
@@ -53,7 +53,7 @@ gdb_load ${binfile}
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index e8611165c07723098ba56363e7b1ad6f1b4be5fb..da56bffd2a7002cafe4d7bb18b5d013aace44888 100644 (file)
@@ -21,7 +21,7 @@
 #
 
 # This test suitable only for process record-replay
-if ![target_info exists gdb,use_precord] {
+if ![supports_process_record] {
     return
 }
 
@@ -34,7 +34,7 @@ if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index dd3bc70e9a117f02b1f8f1403a5e055409b6c5a5..9720f41c0208f4a4c6bf05e24ce756db56230dac 100644 (file)
@@ -20,7 +20,7 @@
 # Test step and next in reverse
 #
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
@@ -33,7 +33,7 @@ if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index f903d5feed4ea2d47598bbab306268197345ec54..edf1a02c9a88e18f5fd66c02ca821644a87e0a53 100644 (file)
@@ -17,7 +17,7 @@
 # 'advance' in precord logfile.
 
 # This test suitable only for process record-replay
-if ![target_info exists gdb,use_precord] {
+if ![supports_process_record] {
     return
 }
 
@@ -38,7 +38,7 @@ set bp_location21 [gdb_get_line_number "set breakpoint 21 here"]
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index 0aeffe8c2ffe92815edfecc03c83d286c0b6e3ad..65adba1a3728e5fadabc71b255ab9c616d81c6d3 100644 (file)
@@ -16,7 +16,7 @@
 # This file is part of the GDB testsuite.  It tests 'until' and 
 # 'advance' in reverse debugging.
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
@@ -37,7 +37,7 @@ set bp_location21 [gdb_get_line_number "set breakpoint 21 here"]
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index 1eaefd0b43b2ced7a3223c26189bd5f985bf4531..b2f661812cd1ae3e622d946a441701418454f0e2 100644 (file)
@@ -18,7 +18,7 @@
 # debugging with watchpoints.
 
 # This test suitable only for process record-replay
-if ![target_info exists gdb,use_precord] {
+if ![supports_process_record] {
     return
 }
 
@@ -32,7 +32,7 @@ if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index ba91e9baffa1d77b4ae5391104046836ddc342fb..70adecf779daaff58795999b3bf06092fb543c6d 100644 (file)
@@ -18,7 +18,7 @@
 # with watchpoints.
 
 
-if ![target_info exists gdb,can_reverse] {
+if ![supports_reverse] {
     return
 }
 
@@ -32,7 +32,7 @@ if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
 
 runto main
 
-if [target_info exists gdb,use_precord] {
+if [supports_process_record] {
     # Activate process record/replay
     gdb_test_no_output "record" "Turn on process record"
 }
index f1900ef76e6b8c616d95b5d79cee414738ccf5c9..3f0bffde56f3488ab3a3ffef992048b1dd2408c6 100644 (file)
@@ -1546,6 +1546,36 @@ proc can_single_step_to_signal_handler {} {
     return 1
 }
 
+# Return 1 if target supports process record, otherwise return 0.
+
+proc supports_process_record {} {
+
+    if [target_info exists gdb,use_precord] {
+       return [target_info gdb,use_precord]
+    }
+
+    if { [istarget "x86_64-*-linux*"] || [istarget "i\[34567\]86-*-linux*"] } {
+       return 1
+    }
+
+    return 0
+}
+
+# Return 1 if target supports reverse debugging, otherwise return 0.
+
+proc supports_reverse {} {
+
+    if [target_info exists gdb,can_reverse] {
+       return [target_info gdb,can_reverse]
+    }
+
+    if { [istarget "x86_64-*-linux*"] || [istarget "i\[34567\]86-*-linux*"] } {
+       return 1
+    }
+
+    return 0
+}
+
 # Return 1 if target is ILP32.
 # This cannot be decided simply from looking at the target string,
 # as it might depend on externally passed compiler options like -m64.