OLD | NEW |
1 # Copyright 1988, 1990-1992, 1994-2000, 2002-2003, 2007-2012 Free | 1 # Copyright 1988-2013 Free Software Foundation, Inc. |
2 # Software Foundation, Inc. | |
3 | 2 |
4 # 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 |
5 # 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 |
6 # the Free Software Foundation; either version 3 of the License, or | 5 # the Free Software Foundation; either version 3 of the License, or |
7 # (at your option) any later version. | 6 # (at your option) any later version. |
8 # | 7 # |
9 # 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, |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 } | 328 } |
330 } | 329 } |
331 } | 330 } |
332 | 331 |
333 # test with bad values | 332 # test with bad values |
334 | 333 |
335 gdb_test "enable" "" "" | 334 gdb_test "enable" "" "" |
336 gdb_test "disable 10" "No breakpoint number 10." \ | 335 gdb_test "disable 10" "No breakpoint number 10." \ |
337 "disable non-existent breakpoint 10" | 336 "disable non-existent breakpoint 10" |
338 | 337 |
339 gdb_test "set \$baz 1.234" | 338 gdb_test_no_output "set \$baz = 1.234" |
340 gdb_test "disable \$baz" \ | 339 gdb_test "disable \$baz" \ |
341 "Convenience variable must have integer value.*" \ | 340 "Convenience variable must have integer value.*" \ |
342 "disable with non-integer convenience var" | 341 "disable with non-integer convenience var" |
343 gdb_test "disable \$grbx" \ | 342 gdb_test "disable \$grbx" \ |
344 "Convenience variable must have integer value.*" \ | 343 "Convenience variable must have integer value.*" \ |
345 "disable with non-existent convenience var" | 344 "disable with non-existent convenience var" |
346 gdb_test "disable \$10" \ | 345 gdb_test "disable \$10" \ |
347 "History has not yet reached .10." \ | 346 "History has not yet reached .10." \ |
348 "disable with non-existent history value" | 347 "disable with non-existent history value" |
349 gdb_test "disable \$1foo" \ | 348 gdb_test "disable \$1foo" \ |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 delete_breakpoints | 769 delete_breakpoints |
771 | 770 |
772 gdb_test "break factorial" "Breakpoint $decimal at .*" "break at factorial" | 771 gdb_test "break factorial" "Breakpoint $decimal at .*" "break at factorial" |
773 | 772 |
774 # Run until we call factorial with 6 | 773 # Run until we call factorial with 6 |
775 | 774 |
776 gdb_run_cmd | 775 gdb_run_cmd |
777 gdb_expect { | 776 gdb_expect { |
778 -re "Break.* factorial .value=6. .*$gdb_prompt $" {} | 777 -re "Break.* factorial .value=6. .*$gdb_prompt $" {} |
779 -re ".*$gdb_prompt $" { | 778 -re ".*$gdb_prompt $" { |
780 » fail "run to factorial(6)"; | 779 » fail "run to factorial(6)" |
781 » gdb_suppress_tests; | 780 » gdb_suppress_tests |
782 } | 781 } |
783 timeout { fail "run to factorial(6) (timeout)" ; gdb_suppress_tests } | 782 timeout { fail "run to factorial(6) (timeout)" ; gdb_suppress_tests } |
784 } | 783 } |
785 | 784 |
786 # Continue until we call factorial recursively with 5. | 785 # Continue until we call factorial recursively with 5. |
787 | 786 |
788 if [gdb_test "continue" \ | 787 if [gdb_test "continue" \ |
789 "Continuing.*Break.* factorial .value=5. .*" \ | 788 "Continuing.*Break.* factorial .value=5. .*" \ |
790 "continue to factorial(5)"] then { gdb_suppress_tests } | 789 "continue to factorial(5)"] then { gdb_suppress_tests } |
791 | 790 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 # OK, we should be back in the same stack frame we started from. | 831 # OK, we should be back in the same stack frame we started from. |
833 # Do a backtrace just to confirm. | 832 # Do a backtrace just to confirm. |
834 | 833 |
835 set result [gdb_test "backtrace" \ | 834 set result [gdb_test "backtrace" \ |
836 "#0\[ \t\]+ factorial .value=120.*\r\n#1\[ \t\]+ \[0-9a-fx\]+ in fac
torial .value=6..*" \ | 835 "#0\[ \t\]+ factorial .value=120.*\r\n#1\[ \t\]+ \[0-9a-fx\]+ in fac
torial .value=6..*" \ |
837 "backtrace from factorial(5.1)"] | 836 "backtrace from factorial(5.1)"] |
838 if { $result != 0 } { gdb_suppress_tests } | 837 if { $result != 0 } { gdb_suppress_tests } |
839 | 838 |
840 if [target_info exists gdb,noresults] { gdb_suppress_tests } | 839 if [target_info exists gdb,noresults] { gdb_suppress_tests } |
841 gdb_continue_to_end "recursive next test" | 840 gdb_continue_to_end "recursive next test" |
842 gdb_stop_suppressing_tests; | 841 gdb_stop_suppressing_tests |
843 } | 842 } |
844 | 843 |
845 test_next_with_recursion | 844 test_next_with_recursion |
846 | 845 |
847 | 846 |
848 #******** | 847 #******** |
849 | 848 |
850 # build a new file with optimization enabled so that we can try breakpoints | 849 # build a new file with optimization enabled so that we can try breakpoints |
851 # on targets with optimized prologues | 850 # on targets with optimized prologues |
852 | 851 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 fail "rbreak junk" | 950 fail "rbreak junk" |
952 } | 951 } |
953 -re ".*Breakpoint \[0-9\]+,.*$gdb_prompt $" { | 952 -re ".*Breakpoint \[0-9\]+,.*$gdb_prompt $" { |
954 pass "rbreak junk" | 953 pass "rbreak junk" |
955 } | 954 } |
956 timeout { | 955 timeout { |
957 fail "rbreak junk (timeout)" | 956 fail "rbreak junk (timeout)" |
958 } | 957 } |
959 } | 958 } |
960 | 959 |
| 960 # |
| 961 # Test break via convenience variable with file name |
| 962 # |
| 963 set line [gdb_get_line_number "set breakpoint 1 here"] |
| 964 gdb_test_no_output "set \$l = $line" |
| 965 gdb_breakpoint ${srcfile}:\$l |
| 966 |
| 967 gdb_test_no_output "set \$foo=81.5" \ |
| 968 "set convenience variable \$foo to 81.5" |
| 969 gdb_test "break $srcfile:\$foo" \ |
| 970 "Convenience variables used in line specs must have integer values.*" \ |
| 971 "set breakpoint via non-integer convenience variable disallowed" |
961 | 972 |
962 # Reset the default arguments for VxWorks | 973 # Reset the default arguments for VxWorks |
963 if [istarget "*-*-vxworks*"] { | 974 if [istarget "*-*-vxworks*"] { |
964 set timeout 10 | 975 set timeout 10 |
965 verbose "Timeout is now $timeout seconds" 2 | 976 verbose "Timeout is now $timeout seconds" 2 |
966 gdb_test_no_output "set args main" | 977 gdb_test_no_output "set args main" |
967 } | 978 } |
OLD | NEW |