| OLD | NEW |
| 1 # Copyright 2009-2012 Free Software Foundation, Inc. | 1 # Copyright 2009-2012 Free Software Foundation, Inc. |
| 2 | 2 |
| 3 # This program is free software; you can redistribute it and/or modify | 3 # This program is free software; you can redistribute it and/or modify |
| 4 # it under the terms of the GNU General Public License as published by | 4 # it under the terms of the GNU General Public License as published by |
| 5 # the Free Software Foundation; either version 3 of the License, or | 5 # the Free Software Foundation; either version 3 of the License, or |
| 6 # (at your option) any later version. | 6 # (at your option) any later version. |
| 7 # | 7 # |
| 8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
| 12 # | 12 # |
| 13 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
| 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | 15 |
| 16 # This file is part of the gdb testsuite. | 16 # This file is part of the gdb testsuite. |
| 17 | 17 |
| 18 # | 18 # |
| 19 # This test tests some i386 general instructions for reverse execution. | 19 # This test tests some i386 general instructions for reverse execution. |
| 20 # | 20 # |
| 21 | 21 |
| 22 if ![supports_reverse] { | 22 if ![supports_reverse] { |
| 23 return | 23 return |
| 24 } | 24 } |
| 25 | 25 |
| 26 if $tracelevel { | |
| 27 strace $tracelevel | |
| 28 } | |
| 29 | |
| 30 | 26 |
| 31 if ![istarget "i?86-*linux*"] then { | 27 if ![istarget "i?86-*linux*"] then { |
| 32 verbose "Skipping i386 reverse tests." | 28 verbose "Skipping i386 reverse tests." |
| 33 return | 29 return |
| 34 } | 30 } |
| 35 | 31 |
| 36 set testfile "i386-reverse" | 32 standard_testfile |
| 37 set srcfile ${testfile}.c | |
| 38 set binfile ${objdir}/${subdir}/${testfile} | |
| 39 | 33 |
| 40 # some targets have leading underscores on assembly symbols. | 34 # some targets have leading underscores on assembly symbols. |
| 41 set additional_flags [gdb_target_symbol_prefix_flags] | 35 set additional_flags [gdb_target_symbol_prefix_flags] |
| 42 | 36 |
| 43 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list
debug $additional_flags]] != "" } { | 37 if {[prepare_for_testing $testfile.exp $testfile $srcfile \ |
| 44 untested i386-reverse | 38 » [list debug $additional_flags]]} { |
| 45 return -1 | 39 return -1 |
| 46 } | 40 } |
| 47 | 41 |
| 48 set end_of_main [gdb_get_line_number " end of main "] | 42 set end_of_main [gdb_get_line_number " end of main "] |
| 49 set end_of_inc_dec_tests [gdb_get_line_number " end inc_dec_tests "] | 43 set end_of_inc_dec_tests [gdb_get_line_number " end inc_dec_tests "] |
| 50 | 44 |
| 51 # Get things started. | |
| 52 | |
| 53 gdb_exit | |
| 54 gdb_start | |
| 55 gdb_reinitialize_dir $srcdir/$subdir | |
| 56 gdb_load ${binfile} | |
| 57 runto main | 45 runto main |
| 58 | 46 |
| 59 if [supports_process_record] { | 47 if [supports_process_record] { |
| 60 # Activate process record/replay | 48 # Activate process record/replay |
| 61 gdb_test_no_output "record" "Turn on process record" | 49 gdb_test_no_output "record" "Turn on process record" |
| 62 } | 50 } |
| 63 | 51 |
| 64 global hex | 52 global hex |
| 65 global decimal | 53 global decimal |
| 66 | 54 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 260 |
| 273 gdb_test "info reg ecx" "ecx *$predec_ecx\t.*" "ecx before reverse-inc" | 261 gdb_test "info reg ecx" "ecx *$predec_ecx\t.*" "ecx before reverse-inc" |
| 274 gdb_test "reverse-step" "inc .ecx.*" "reverse-step to inc ecx" | 262 gdb_test "reverse-step" "inc .ecx.*" "reverse-step to inc ecx" |
| 275 gdb_test "info reg ecx" "ecx *$preinc_ecx\t.*" "ecx after reverse-inc" | 263 gdb_test "info reg ecx" "ecx *$preinc_ecx\t.*" "ecx after reverse-inc" |
| 276 | 264 |
| 277 gdb_test "info reg eax" "eax *$predec_eax\t.*" "eax before reverse-inc" | 265 gdb_test "info reg eax" "eax *$predec_eax\t.*" "eax before reverse-inc" |
| 278 gdb_test "reverse-step" "inc .eax.*" "reverse-step to inc eax" | 266 gdb_test "reverse-step" "inc .eax.*" "reverse-step to inc eax" |
| 279 gdb_test "info reg eax" "eax *$preinc_eax\t.*" "eax after reverse-inc" | 267 gdb_test "info reg eax" "eax *$preinc_eax\t.*" "eax after reverse-inc" |
| 280 | 268 |
| 281 | 269 |
| OLD | NEW |