diff options
author | Yao Qi <yao@codesourcery.com> | 2011-11-08 08:23:49 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2011-11-08 08:23:49 +0000 |
commit | d3895d7d29f0063fdae6bc1a78a23fcfb2570fed (patch) | |
tree | 296b00d8d3d12e610d95a925cff8694009378663 | |
parent | ce3b0ff733bf157b81e9548f72a3c49c117252ed (diff) | |
download | binutils-gdb-d3895d7d29f0063fdae6bc1a78a23fcfb2570fed.tar.gz |
gdb/testsuite/
* 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, 106 insertions, 46 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a98cb082af5..8faa846ef1e 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -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 diff --git a/gdb/testsuite/gdb.reverse/break-precsave.exp b/gdb/testsuite/gdb.reverse/break-precsave.exp index c7e492bbe04..dc035c06ac4 100644 --- a/gdb/testsuite/gdb.reverse/break-precsave.exp +++ b/gdb/testsuite/gdb.reverse/break-precsave.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/break-reverse.exp b/gdb/testsuite/gdb.reverse/break-reverse.exp index fd77bc51001..d76a0e6dd98 100644 --- a/gdb/testsuite/gdb.reverse/break-reverse.exp +++ b/gdb/testsuite/gdb.reverse/break-reverse.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp index 86923f623e8..68d6f83b023 100644 --- a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp +++ b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp index 967236f927a..7027729344f 100644 --- a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp +++ b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/finish-precsave.exp b/gdb/testsuite/gdb.reverse/finish-precsave.exp index fbf35b63bfd..7ba7b88fde0 100644 --- a/gdb/testsuite/gdb.reverse/finish-precsave.exp +++ b/gdb/testsuite/gdb.reverse/finish-precsave.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp b/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp index 09f68372c27..4a8990a6c70 100644 --- a/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp +++ b/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/finish-reverse.exp b/gdb/testsuite/gdb.reverse/finish-reverse.exp index e6be1587498..0708b37d56c 100644 --- a/gdb/testsuite/gdb.reverse/finish-reverse.exp +++ b/gdb/testsuite/gdb.reverse/finish-reverse.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/i386-precsave.exp b/gdb/testsuite/gdb.reverse/i386-precsave.exp index 10d8ba3c4a8..e82dc90ccbc 100644 --- a/gdb/testsuite/gdb.reverse/i386-precsave.exp +++ b/gdb/testsuite/gdb.reverse/i386-precsave.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/i386-reverse.exp b/gdb/testsuite/gdb.reverse/i386-reverse.exp index f9fda5ee477..0d7e57a5854 100644 --- a/gdb/testsuite/gdb.reverse/i386-reverse.exp +++ b/gdb/testsuite/gdb.reverse/i386-reverse.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp b/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp index 3e7664342bc..2641b3a2b17 100644 --- a/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp +++ b/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/machinestate-precsave.exp b/gdb/testsuite/gdb.reverse/machinestate-precsave.exp index a2f2515aefe..adc58dab51d 100644 --- a/gdb/testsuite/gdb.reverse/machinestate-precsave.exp +++ b/gdb/testsuite/gdb.reverse/machinestate-precsave.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/machinestate.exp b/gdb/testsuite/gdb.reverse/machinestate.exp index bc2516e09a7..d51a4a3a167 100644 --- a/gdb/testsuite/gdb.reverse/machinestate.exp +++ b/gdb/testsuite/gdb.reverse/machinestate.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp b/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp index 9a95dca1ced..187eb24c760 100644 --- a/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp +++ b/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/sigall-precsave.exp b/gdb/testsuite/gdb.reverse/sigall-precsave.exp index 94144d33ee1..a8c4184239a 100644 --- a/gdb/testsuite/gdb.reverse/sigall-precsave.exp +++ b/gdb/testsuite/gdb.reverse/sigall-precsave.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/sigall-reverse.exp b/gdb/testsuite/gdb.reverse/sigall-reverse.exp index d152965bb50..f4bd0854cf3 100644 --- a/gdb/testsuite/gdb.reverse/sigall-reverse.exp +++ b/gdb/testsuite/gdb.reverse/sigall-reverse.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/solib-precsave.exp b/gdb/testsuite/gdb.reverse/solib-precsave.exp index be6502fe3e2..71b9ce3a946 100644 --- a/gdb/testsuite/gdb.reverse/solib-precsave.exp +++ b/gdb/testsuite/gdb.reverse/solib-precsave.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/solib-reverse.exp b/gdb/testsuite/gdb.reverse/solib-reverse.exp index 1a516051c19..f57616cb67a 100644 --- a/gdb/testsuite/gdb.reverse/solib-reverse.exp +++ b/gdb/testsuite/gdb.reverse/solib-reverse.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/step-precsave.exp b/gdb/testsuite/gdb.reverse/step-precsave.exp index e8611165c07..da56bffd2a7 100644 --- a/gdb/testsuite/gdb.reverse/step-precsave.exp +++ b/gdb/testsuite/gdb.reverse/step-precsave.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/step-reverse.exp b/gdb/testsuite/gdb.reverse/step-reverse.exp index dd3bc70e9a1..9720f41c020 100644 --- a/gdb/testsuite/gdb.reverse/step-reverse.exp +++ b/gdb/testsuite/gdb.reverse/step-reverse.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/until-precsave.exp b/gdb/testsuite/gdb.reverse/until-precsave.exp index f903d5feed4..edf1a02c9a8 100644 --- a/gdb/testsuite/gdb.reverse/until-precsave.exp +++ b/gdb/testsuite/gdb.reverse/until-precsave.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/until-reverse.exp b/gdb/testsuite/gdb.reverse/until-reverse.exp index 0aeffe8c2ff..65adba1a372 100644 --- a/gdb/testsuite/gdb.reverse/until-reverse.exp +++ b/gdb/testsuite/gdb.reverse/until-reverse.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/watch-precsave.exp b/gdb/testsuite/gdb.reverse/watch-precsave.exp index 1eaefd0b43b..b2f661812cd 100644 --- a/gdb/testsuite/gdb.reverse/watch-precsave.exp +++ b/gdb/testsuite/gdb.reverse/watch-precsave.exp @@ -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" } diff --git a/gdb/testsuite/gdb.reverse/watch-reverse.exp b/gdb/testsuite/gdb.reverse/watch-reverse.exp index ba91e9baffa..70adecf779d 100644 --- a/gdb/testsuite/gdb.reverse/watch-reverse.exp +++ b/gdb/testsuite/gdb.reverse/watch-reverse.exp @@ -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" } diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index f1900ef76e6..3f0bffde56f 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -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. |