| 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 'finish' with | 16 # This file is part of the GDB testsuite. It tests 'finish' with |
| 17 # reverse debugging. | 17 # reverse debugging. |
| 18 | 18 |
| 19 if ![supports_reverse] { | 19 if ![supports_reverse] { |
| 20 return | 20 return |
| 21 } | 21 } |
| 22 | 22 |
| 23 set testfile "finish-reverse" | 23 standard_testfile finish-reverse.c |
| 24 set srcfile ${testfile}.c | 24 set precsave [standard_output_file finish.precsave] |
| 25 | 25 |
| 26 if { [prepare_for_testing $testfile.exp "$testfile" $srcfile] } { | 26 if { [prepare_for_testing $testfile.exp "$testfile" $srcfile] } { |
| 27 return -1 | 27 return -1 |
| 28 } | 28 } |
| 29 | 29 |
| 30 runto main | 30 runto main |
| 31 | 31 |
| 32 if [supports_process_record] { | 32 if [supports_process_record] { |
| 33 # Activate process record/replay | 33 # Activate process record/replay |
| 34 gdb_test_no_output "record" "Turn on process record" | 34 gdb_test_no_output "record" "Turn on process record" |
| 35 } | 35 } |
| 36 | 36 |
| 37 # Run until end, then save execution log. | 37 # Run until end, then save execution log. |
| 38 | 38 |
| 39 set breakloc [gdb_get_line_number "end of main" "$srcfile"] | 39 set breakloc [gdb_get_line_number "end of main" "$srcfile"] |
| 40 gdb_test "break $breakloc" \ | 40 gdb_test "break $breakloc" \ |
| 41 "Breakpoint $decimal at .*/$srcfile, line $breakloc\." \ | 41 "Breakpoint $decimal at .*/$srcfile, line $breakloc\." \ |
| 42 "BP at end of main" | 42 "BP at end of main" |
| 43 | 43 |
| 44 gdb_test "continue" "Breakpoint .* end of main .*" "run to end of main" | 44 gdb_test "continue" "Breakpoint .* end of main .*" "run to end of main" |
| 45 | 45 |
| 46 gdb_test "record save finish.precsave" \ | 46 gdb_test "record save $precsave" \ |
| 47 "Saved core file finish.precsave with execution log\." \ | 47 "Saved core file $precsave with execution log\." \ |
| 48 "save process recfile" | 48 "save process recfile" |
| 49 | 49 |
| 50 gdb_test "kill" "" "Kill process, prepare to debug log file" \ | 50 gdb_test "kill" "" "Kill process, prepare to debug log file" \ |
| 51 "Kill the program being debugged\\? \\(y or n\\) " "y" | 51 "Kill the program being debugged\\? \\(y or n\\) " "y" |
| 52 | 52 |
| 53 gdb_test "record restore finish.precsave" \ | 53 gdb_test "record restore $precsave" \ |
| 54 "Program terminated with signal .*" \ | 54 "Program terminated with signal .*" \ |
| 55 "reload precord save file" | 55 "reload precord save file" |
| 56 | 56 |
| 57 # Test finish from void func | 57 # Test finish from void func |
| 58 | 58 |
| 59 set breakloc [gdb_get_line_number "VOID FUNC" "$srcfile"] | 59 set breakloc [gdb_get_line_number "VOID FUNC" "$srcfile"] |
| 60 gdb_test "break void_func" \ | 60 gdb_test "break void_func" \ |
| 61 "Breakpoint $decimal at .*/$srcfile, line $breakloc\." \ | 61 "Breakpoint $decimal at .*/$srcfile, line $breakloc\." \ |
| 62 "set breakpoint on void_func" | 62 "set breakpoint on void_func" |
| 63 gdb_continue_to_breakpoint "void_func" ".*/$srcfile:$breakloc.*" | 63 gdb_continue_to_breakpoint "void_func" ".*/$srcfile:$breakloc.*" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 set breakloc [gdb_get_line_number "VOID FUNC" "$srcfile"] | 241 set breakloc [gdb_get_line_number "VOID FUNC" "$srcfile"] |
| 242 gdb_continue_to_breakpoint "void_func" ".*/$srcfile:$breakloc.*" | 242 gdb_continue_to_breakpoint "void_func" ".*/$srcfile:$breakloc.*" |
| 243 | 243 |
| 244 set test_msg "reverse finish from void_func" | 244 set test_msg "reverse finish from void_func" |
| 245 gdb_test_multiple "finish" "$test_msg" { | 245 gdb_test_multiple "finish" "$test_msg" { |
| 246 -re ".* call to void_func.*$gdb_prompt $" { | 246 -re ".* call to void_func.*$gdb_prompt $" { |
| 247 pass "$test_msg" | 247 pass "$test_msg" |
| 248 } | 248 } |
| 249 } | 249 } |
| OLD | NEW |