OLD | NEW |
1 # Copyright 2011-2012 Free Software Foundation, Inc. | 1 # Copyright 2011-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 was written by Justin Lebar. (justin.lebar@gmail.com) | 16 # This file was written by Justin Lebar. (justin.lebar@gmail.com) |
17 | 17 |
18 if { [prepare_for_testing skip.exp "skip" \ | 18 if { [prepare_for_testing skip.exp "skip" \ |
19 {skip.c skip1.c } \ | 19 {skip.c skip1.c } \ |
20 {debug nowarnings}] } { | 20 {debug nowarnings}] } { |
21 return -1 | 21 return -1 |
22 } | 22 } |
23 | 23 |
24 set srcfile skip.c | 24 set srcfile skip.c |
25 set srcfile1 skip1.c | 25 set srcfile1 skip1.c |
26 | 26 |
27 # | 27 # |
28 # Right after we start gdb, there's no default file or function to skip. | 28 # Right after we start gdb, there's no default file or function to skip. |
29 # | 29 # |
30 gdb_test "skip file" "No default file now." | 30 gdb_test "skip file" "No default file now." "skip file (no default file)" |
31 gdb_test "skip function" "No default function now." | 31 gdb_test "skip function" "No default function now." |
32 gdb_test "skip" "No default function now." | 32 gdb_test "skip" "No default function now." "skip (no default function)" |
33 | 33 |
34 if ![runto_main] { fail "skip tests suppressed" } | 34 if ![runto_main] { fail "skip tests suppressed" } |
35 | 35 |
36 # | 36 # |
37 # Test |info skip| with an empty skiplist. | 37 # Test |info skip| with an empty skiplist. |
38 # | 38 # |
39 gdb_test "info skip" "Not skipping any files or functions\." "info skip empty" | 39 gdb_test "info skip" "Not skipping any files or functions\." "info skip empty" |
40 | 40 |
41 # | 41 # |
42 # Create a skiplist entry for the current file and function. | 42 # Create a skiplist entry for the current file and function. |
43 # | 43 # |
44 gdb_test "skip file" "File .*$srcfile will be skipped when stepping\." | 44 gdb_test "skip file" "File .*$srcfile will be skipped when stepping\." "skip fil
e ($srcfile)" |
45 gdb_test "skip" "Function main at .* will be skipped when stepping\." | 45 gdb_test "skip" "Function main at .* will be skipped when stepping\." "skip (mai
n)" |
46 | 46 |
47 # | 47 # |
48 # Create a skiplist entry for a specified file and function. | 48 # Create a skiplist entry for a specified file and function. |
49 # | 49 # |
50 gdb_test "skip file skip1.c" "File .*$srcfile1 will be skipped when stepping\." | 50 gdb_test "skip file skip1.c" "File .*$srcfile1 will be skipped when stepping\." |
51 gdb_test "skip function baz" "Function baz at .* will be skipped when stepping\.
" | 51 gdb_test "skip function baz" "Function baz at .* will be skipped when stepping\.
" |
52 | 52 |
53 # | 53 # |
54 # Test bad skiplist entry modification commands | 54 # Test bad skiplist entry modification commands |
55 # | 55 # |
(...skipping 19 matching lines...) Expand all Loading... |
75 3\\s+file\\s+y\\s+.*$srcfile1\\s* | 75 3\\s+file\\s+y\\s+.*$srcfile1\\s* |
76 4\\s+function\\s+y\\s+0x\[0-9a-f\]+ baz at .*$srcfile1:\[0-9\]+\\s*" | 76 4\\s+function\\s+y\\s+0x\[0-9a-f\]+ baz at .*$srcfile1:\[0-9\]+\\s*" |
77 | 77 |
78 # | 78 # |
79 # Right now, we have an outstanding skiplist entry on both source | 79 # Right now, we have an outstanding skiplist entry on both source |
80 # files, so when we step into the first line in main(), we should step | 80 # files, so when we step into the first line in main(), we should step |
81 # right over it and go to the second line of main(). | 81 # right over it and go to the second line of main(). |
82 # | 82 # |
83 | 83 |
84 if ![runto_main] { fail "skip tests suppressed" } | 84 if ![runto_main] { fail "skip tests suppressed" } |
85 gdb_test "step" | 85 gdb_test "step" ".*" "step in the main" |
86 gdb_test "bt" "\\s*\\#0\\s+main.*" "step after all ignored" | 86 gdb_test "bt" "\\s*\\#0\\s+main.*" "step after all ignored" |
87 | 87 |
88 # | 88 # |
89 # Now remove skip.c from the skiplist. Our first step should take us | 89 # Now remove skip.c from the skiplist. Our first step should take us |
90 # into foo(), and our second step should take us to the next line in | 90 # into foo(), and our second step should take us to the next line in |
91 # main(). | 91 # main(). |
92 # | 92 # |
93 gdb_test "skip delete 1" | 93 gdb_test "skip delete 1" |
94 # Check that entry 1 is missing from |info skip| | 94 # Check that entry 1 is missing from |info skip| |
95 gdb_test "info skip" \ | 95 gdb_test "info skip" \ |
96 "Num\\s+Type\\s+Enb\\s+Address\\s+What\\s* | 96 "Num\\s+Type\\s+Enb\\s+Address\\s+What\\s* |
97 2\\s+function\\s+y\\s+0x\[0-9a-f\]+ main at .*$srcfile:\[0-9\]+\\s* | 97 2\\s+function\\s+y\\s+0x\[0-9a-f\]+ main at .*$srcfile:\[0-9\]+\\s* |
98 3\\s+file\\s+y\\s+.*$srcfile1\\s* | 98 3\\s+file\\s+y\\s+.*$srcfile1\\s* |
99 4\\s+function\\s+y\\s+0x\[0-9a-f\]+ baz at .*$srcfile1:\[0-9\]+\\s*" | 99 4\\s+function\\s+y\\s+0x\[0-9a-f\]+ baz at .*$srcfile1:\[0-9\]+\\s*" \ |
| 100 "info skip (delete 1)" |
100 | 101 |
101 if ![runto_main] { fail "skip tests suppressed" } | 102 if ![runto_main] { fail "skip tests suppressed" } |
102 gdb_test "step" "foo \\(\\) at.*" "step after deleting 1 (1)" | 103 gdb_test "step" "foo \\(\\) at.*" "step after deleting 1 (1)" |
103 gdb_test "step"; # Return from foo() | 104 gdb_test "step" ".*" "step after deleting 1 (2)" ; # Return from foo() |
104 gdb_test "step" "main \\(\\) at.*" "step after deleting 1 (2)" | 105 gdb_test "step" "main \\(\\) at.*" "step after deleting 1 (3)" |
105 | 106 |
106 # | 107 # |
107 # Now disable the skiplist entry for skip1.c. We should now | 108 # Now disable the skiplist entry for skip1.c. We should now |
108 # step into foo(), then into bar(), but not into baz(). | 109 # step into foo(), then into bar(), but not into baz(). |
109 # | 110 # |
110 gdb_test "skip disable 3" | 111 gdb_test "skip disable 3" |
111 # Is entry 3 disabled in |info skip|? | 112 # Is entry 3 disabled in |info skip|? |
112 gdb_test "info skip 3" ".*\\n3\\s+file\\s+n.*" \ | 113 gdb_test "info skip 3" ".*\\n3\\s+file\\s+n.*" \ |
113 "info skip shows entry as disabled" | 114 "info skip shows entry as disabled" |
114 | 115 |
115 if ![runto_main] { fail "skip tests suppressed" } | 116 if ![runto_main] { fail "skip tests suppressed" } |
116 gdb_test "step" "bar \\(\\) at.*" "step after disabling 3 (1)" | 117 gdb_test "step" "bar \\(\\) at.*" "step after disabling 3 (1)" |
117 gdb_test "step"; # Return from foo() | 118 gdb_test "step" ".*" "step after disabling 3 (2)"; # Return from foo() |
118 gdb_test "step" "foo \\(\\) at.*" "step after disabling 3 (2)" | 119 gdb_test "step" "foo \\(\\) at.*" "step after disabling 3 (3)" |
119 gdb_test "step"; # Return from bar() | 120 gdb_test "step" ".*" "step after disabling 3 (4)"; # Return from bar() |
120 gdb_test "step" "main \\(\\) at.*" "step after disabling 3 (3)" | 121 gdb_test "step" "main \\(\\) at.*" "step after disabling 3 (5)" |
121 | 122 |
122 # | 123 # |
123 # Enable skiplist entry 3 and make sure we step over it like before. | 124 # Enable skiplist entry 3 and make sure we step over it like before. |
124 # | 125 # |
125 gdb_test "skip enable 3" | 126 gdb_test "skip enable 3" |
126 # Is entry 3 enabled in |info skip|? | 127 # Is entry 3 enabled in |info skip|? |
127 gdb_test "info skip 3" ".*\\n3\\s+file\\s+y.*" \ | 128 gdb_test "info skip 3" ".*\\n3\\s+file\\s+y.*" \ |
128 "info skip shows entry as enabled" | 129 "info skip shows entry as enabled" |
129 if ![runto_main] { fail "skip tests suppressed" } | 130 if ![runto_main] { fail "skip tests suppressed" } |
130 gdb_test "step" "foo \\(\\) at.*" "step after deleting 1 (1)" | 131 gdb_test "step" "foo \\(\\) at.*" "step after enable 3 (1)" |
131 gdb_test "step"; # Return from foo() | 132 gdb_test "step" ".*" "step after enable 3 (2)"; # Return from foo() |
132 gdb_test "step" "main \\(\\) at.*" "step after deleting 1 (2)" | 133 gdb_test "step" "main \\(\\) at.*" "step after enable 3 (3)" |
133 | 134 |
134 gdb_test "skip disable" | 135 gdb_test "skip disable" |
135 gdb_test "info skip" \ | 136 gdb_test "info skip" \ |
136 "Num\\s+Type\\s+Enb\\s+Address\\s+What\\s* | 137 "Num\\s+Type\\s+Enb\\s+Address\\s+What\\s* |
137 2\\s+function\\s+n\\s+0x\[0-9a-f\]+ main at .*$srcfile:\[0-9\]+\\s* | 138 2\\s+function\\s+n\\s+0x\[0-9a-f\]+ main at .*$srcfile:\[0-9\]+\\s* |
138 3\\s+file\\s+n\\s+.*$srcfile1\\s* | 139 3\\s+file\\s+n\\s+.*$srcfile1\\s* |
139 4\\s+function\\s+n\\s+0x\[0-9a-f\]+ baz at .*$srcfile1:\[0-9\]+\\s*" \ | 140 4\\s+function\\s+n\\s+0x\[0-9a-f\]+ baz at .*$srcfile1:\[0-9\]+\\s*" \ |
140 "info skip after disabling all" | 141 "info skip after disabling all" |
141 | 142 |
142 gdb_test "skip enable" | 143 gdb_test "skip enable" |
(...skipping 27 matching lines...) Expand all Loading... |
170 "info skip 2-3" | 171 "info skip 2-3" |
171 | 172 |
172 gdb_test "skip delete 2 3" | 173 gdb_test "skip delete 2 3" |
173 gdb_test "info skip" \ | 174 gdb_test "info skip" \ |
174 "4\\s+function\\s+n\\s+0x\[0-9a-f\]+ baz at .*$srcfile1:\[0-9\]+\\s*" \ | 175 "4\\s+function\\s+n\\s+0x\[0-9a-f\]+ baz at .*$srcfile1:\[0-9\]+\\s*" \ |
175 "info skip after deleting 2 3" | 176 "info skip after deleting 2 3" |
176 | 177 |
177 gdb_test "skip delete" | 178 gdb_test "skip delete" |
178 gdb_test "info skip" "Not skipping any files or functions\." \ | 179 gdb_test "info skip" "Not skipping any files or functions\." \ |
179 "info skip after deleting all" | 180 "info skip after deleting all" |
OLD | NEW |