| OLD | NEW |
| 1 # Copyright 2008-2012 Free Software Foundation, Inc. | 1 # Copyright 2008-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. It tests reverse debugging | 16 # This file is part of the GDB testsuite. It tests reverse debugging |
| 17 # with breakpoints in a process record logfile. | 17 # with breakpoints in a process record logfile. |
| 18 | 18 |
| 19 # This test suitable only for process record-replay | 19 # This test suitable only for process record-replay |
| 20 if ![supports_process_record] { | 20 if ![supports_process_record] { |
| 21 return | 21 return |
| 22 } | 22 } |
| 23 | 23 |
| 24 set testfile "break-reverse" | 24 standard_testfile break-reverse.c |
| 25 set srcfile ${testfile}.c | 25 set precsave [standard_output_file break.precsave] |
| 26 | 26 |
| 27 if { [prepare_for_testing $testfile.exp $testfile $srcfile] } { | 27 if { [prepare_for_testing $testfile.exp $testfile $srcfile] } { |
| 28 return -1 | 28 return -1 |
| 29 } | 29 } |
| 30 | 30 |
| 31 set foo_location [gdb_get_line_number "break in foo" ] | 31 set foo_location [gdb_get_line_number "break in foo" ] |
| 32 set bar_location [gdb_get_line_number "break in bar" ] | 32 set bar_location [gdb_get_line_number "break in bar" ] |
| 33 set main_location [gdb_get_line_number "break in main"] | 33 set main_location [gdb_get_line_number "break in main"] |
| 34 set end_location [gdb_get_line_number "end of main" ] | 34 set end_location [gdb_get_line_number "end of main" ] |
| 35 | 35 |
| 36 runto main | 36 runto main |
| 37 | 37 |
| 38 if [supports_process_record] { | 38 if [supports_process_record] { |
| 39 # Activate process record/replay | 39 # Activate process record/replay |
| 40 gdb_test_no_output "record" "Turn on process record" | 40 gdb_test_no_output "record" "Turn on process record" |
| 41 } | 41 } |
| 42 | 42 |
| 43 gdb_test "break $end_location" \ | 43 gdb_test "break $end_location" \ |
| 44 "Breakpoint $decimal at .*/$srcfile, line $end_location\." \ | 44 "Breakpoint $decimal at .*/$srcfile, line $end_location\." \ |
| 45 "BP at end of main" | 45 "BP at end of main" |
| 46 | 46 |
| 47 gdb_test "continue" "Breakpoint .* end of main .*" "run to end of main" | 47 gdb_test "continue" "Breakpoint .* end of main .*" "run to end of main" |
| 48 | 48 |
| 49 gdb_test "record save break.precsave" \ | 49 gdb_test "record save $precsave" \ |
| 50 "Saved core file break.precsave with execution log\." \ | 50 "Saved core file $precsave with execution log\." \ |
| 51 "save process recfile" | 51 "save process recfile" |
| 52 | 52 |
| 53 gdb_test "kill" "" "Kill process, prepare to debug log file" \ | 53 gdb_test "kill" "" "Kill process, prepare to debug log file" \ |
| 54 "Kill the program being debugged\\? \\(y or n\\) " "y" | 54 "Kill the program being debugged\\? \\(y or n\\) " "y" |
| 55 | 55 |
| 56 gdb_test "record restore break.precsave" \ | 56 gdb_test "record restore $precsave" \ |
| 57 "Program terminated with signal .*" \ | 57 "Program terminated with signal .*" \ |
| 58 "reload precord save file" | 58 "reload precord save file" |
| 59 | 59 |
| 60 gdb_test "break foo" \ | 60 gdb_test "break foo" \ |
| 61 "Breakpoint $decimal at .* line $foo_location\." \ | 61 "Breakpoint $decimal at .* line $foo_location\." \ |
| 62 "set breakpoint on foo" | 62 "set breakpoint on foo" |
| 63 | 63 |
| 64 gdb_test "break bar" \ | 64 gdb_test "break bar" \ |
| 65 "Breakpoint $decimal at .* line $bar_location\." \ | 65 "Breakpoint $decimal at .* line $bar_location\." \ |
| 66 "set breakpoint on bar" | 66 "set breakpoint on bar" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 96 gdb_continue_to_breakpoint "bar" ".*/$srcfile:$bar_location.*" | 96 gdb_continue_to_breakpoint "bar" ".*/$srcfile:$bar_location.*" |
| 97 | 97 |
| 98 gdb_test_multiple "continue" "end of record log" { | 98 gdb_test_multiple "continue" "end of record log" { |
| 99 -re ".*Breakpoint $decimal,.*/$srcfile:$end_location.*$gdb_prompt $" { | 99 -re ".*Breakpoint $decimal,.*/$srcfile:$end_location.*$gdb_prompt $" { |
| 100 pass "end of record log" | 100 pass "end of record log" |
| 101 } | 101 } |
| 102 -re "No more reverse-execution history.* end of main .*$gdb_prompt $" { | 102 -re "No more reverse-execution history.* end of main .*$gdb_prompt $" { |
| 103 pass "end of record log" | 103 pass "end of record log" |
| 104 } | 104 } |
| 105 } | 105 } |
| OLD | NEW |