OLD | NEW |
1 # Copyright 2003, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 2003, 2007-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 # advance.exp -- Expect script to test 'advance' in gdb | 16 # advance.exp -- Expect script to test 'advance' in gdb |
17 | 17 |
18 if $tracelevel then { | |
19 strace $tracelevel | |
20 } | |
21 | |
22 set testfile advance | 18 set testfile advance |
23 set srcfile ${testfile}.c | 19 set srcfile ${testfile}.c |
24 set binfile ${objdir}/${subdir}/${testfile} | 20 set binfile ${objdir}/${subdir}/${testfile} |
25 | 21 |
26 remote_exec build "rm -f ${binfile}" | 22 remote_exec build "rm -f ${binfile}" |
27 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
g}] != "" } { | 23 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
g}] != "" } { |
28 untested advance.exp | 24 untested advance.exp |
29 return -1 | 25 return -1 |
30 } | 26 } |
31 | 27 |
(...skipping 10 matching lines...) Expand all Loading... |
42 # Verify that "advance <location>" works. (This is really just syntactic | 38 # Verify that "advance <location>" works. (This is really just syntactic |
43 # sugar for "tbreak <location>; continue".) | 39 # sugar for "tbreak <location>; continue".) |
44 # | 40 # |
45 gdb_test "advance [gdb_get_line_number "advance this location"]" \ | 41 gdb_test "advance [gdb_get_line_number "advance this location"]" \ |
46 "main .* at .*:.*b = 3.*advance this location.*" \ | 42 "main .* at .*:.*b = 3.*advance this location.*" \ |
47 "advance line number" | 43 "advance line number" |
48 | 44 |
49 # Verify that a malformed "advance" is gracefully caught. | 45 # Verify that a malformed "advance" is gracefully caught. |
50 # | 46 # |
51 gdb_test "advance [gdb_get_line_number "advance malformed"] then stop" \ | 47 gdb_test "advance [gdb_get_line_number "advance malformed"] then stop" \ |
52 » "Junk at end of arguments." "malformed advance" | 48 "malformed linespec error: unexpected string, \"then stop\"" \ |
| 49 "malformed advance" |
53 | 50 |
54 # Verify that "advance <funcname>" works. | 51 # Verify that "advance <funcname>" works. |
55 # | 52 # |
56 gdb_test "advance func" \ | 53 gdb_test "advance func" \ |
57 "func.*at.*x = x \\+ 5." \ | 54 "func.*at.*x = x \\+ 5." \ |
58 "advance func" | 55 "advance func" |
59 | 56 |
60 # Verify that "advance <funcname>" when funcname is NOT called by the current | 57 # Verify that "advance <funcname>" when funcname is NOT called by the current |
61 # frame, stops at the end of the current frame. | 58 # frame, stops at the end of the current frame. |
62 # | 59 # |
(...skipping 20 matching lines...) Expand all Loading... |
83 gdb_test "advance foo" \ | 80 gdb_test "advance foo" \ |
84 "foo \\(a=5\\).*int b = a \\+ 10;"\ | 81 "foo \\(a=5\\).*int b = a \\+ 10;"\ |
85 "advance function called as param" | 82 "advance function called as param" |
86 | 83 |
87 # Verify that we get an error if we use 'advance' w/o argument | 84 # Verify that we get an error if we use 'advance' w/o argument |
88 # | 85 # |
89 gdb_test "advance" \ | 86 gdb_test "advance" \ |
90 "Argument required \\(a location\\)."\ | 87 "Argument required \\(a location\\)."\ |
91 "advance with no argument" | 88 "advance with no argument" |
92 | 89 |
OLD | NEW |