GNU Binutils with patches for OS216
Revisão | cee62dbd8771e22856d950c2615fb463305a9fcb (tree) |
---|---|
Hora | 2017-11-07 20:06:49 |
Autor | Pedro Alves <palves@redh...> |
Commiter | Pedro Alves |
Add base 'enable/disable invalid location range' tests
This adds tests that exercise the "bad breakpoint number" paths.
Specifically:
I'm adding this as a baseline to improve. This shows that there's a
lot of inconsistency in GDB's output (e.g., "bad" vs "Bad").
Also, IMO, the "0-0" and inverted range cases should be loud errors.
That and more will all be addressed in the next patch.
gdb/testsuite/ChangeLog:
2017-11-07 Pedro Alves <palves@redhat.com>
* gdb.cp/ena-dis-br-range.exp: Add tests.
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2017-11-07 Pedro Alves <palves@redhat.com> |
2 | 2 | |
3 | + * gdb.cp/ena-dis-br-range.exp: Add tests. | |
4 | + | |
5 | +2017-11-07 Pedro Alves <palves@redhat.com> | |
6 | + | |
3 | 7 | * gdb.base/ena-dis-br.exp: Don't expect "warning:". |
4 | 8 | |
5 | 9 | 2017-11-07 Xavier Roirand <roirand@adacore.com> |
@@ -130,3 +130,41 @@ gdb_test_no_output "disable 2.8-6" | ||
130 | 130 | |
131 | 131 | gdb_test "info break" [make_info_breakpoint_reply_re y y y y y y] \ |
132 | 132 | "breakpoint info disable 2.8-6" |
133 | + | |
134 | +# Check that invalid/open ranges are handled correctly. | |
135 | +with_test_prefix "open range" { | |
136 | + gdb_test "disable -" "bad breakpoint number at or near: '-'" | |
137 | + gdb_test "disable -1" "bad breakpoint number at or near: '-1'" | |
138 | + gdb_test "disable 1-" "bad breakpoint number at or near: '1-'" | |
139 | + gdb_test "disable 1.-2" "Bad breakpoint location number '-2'" | |
140 | + gdb_test "disable 1.2-" "bad breakpoint number at or near: '2-'" | |
141 | + gdb_test "disable 1.-2-3" "Bad breakpoint location number '-2'" | |
142 | + gdb_test "disable 1-2-3" "bad breakpoint number at or near: '1-2-3'" | |
143 | +} | |
144 | + | |
145 | +with_test_prefix "dangling period" { | |
146 | + gdb_test "disable 2." "bad breakpoint number at or near: '2.'" | |
147 | + gdb_test "disable .2" "bad breakpoint number at or near: '.2'" | |
148 | + gdb_test "disable 2.3.4" "bad breakpoint number at or near '2.3.4'" | |
149 | +} | |
150 | + | |
151 | +# Check that 0s are handled correctly. | |
152 | +with_test_prefix "zero" { | |
153 | + gdb_test "disable 0" "bad breakpoint number at or near '0'" | |
154 | + gdb_test "disable 0.0" "Bad breakpoint number '0.0'" | |
155 | + gdb_test "disable 0.1" "Bad breakpoint number '0.1'" | |
156 | + gdb_test "disable 0.1-2" "Bad breakpoint number '0.1-2'" | |
157 | + gdb_test "disable 2.0" "bad breakpoint number at or near '2.0'" | |
158 | + | |
159 | + # These should really fail... | |
160 | + gdb_test_no_output "disable 2.0-0" | |
161 | + gdb_test_no_output "enable 2.0-0" | |
162 | + | |
163 | + gdb_test "disable 2.0-1" "Bad breakpoint location number '0'" | |
164 | + | |
165 | + # Likewise, should fail. | |
166 | + gdb_test_no_output "disable 2.1-0" | |
167 | +} | |
168 | + | |
169 | +gdb_test "info break" [make_info_breakpoint_reply_re y y y y y y] \ | |
170 | + "breakpoint info after invalids" |