• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisãocee62dbd8771e22856d950c2615fb463305a9fcb (tree)
Hora2017-11-07 20:06:49
AutorPedro Alves <palves@redh...>
CommiterPedro Alves

Mensagem de Log

Add base 'enable/disable invalid location range' tests

This adds tests that exercise the "bad breakpoint number" paths.
Specifically:

- malformed ranges
- use of explicit 0 as bp/loc number.
- inverted ranges

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.

Mudança Sumário

Diff

--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
11 2017-11-07 Pedro Alves <palves@redhat.com>
22
3+ * gdb.cp/ena-dis-br-range.exp: Add tests.
4+
5+2017-11-07 Pedro Alves <palves@redhat.com>
6+
37 * gdb.base/ena-dis-br.exp: Don't expect "warning:".
48
59 2017-11-07 Xavier Roirand <roirand@adacore.com>
--- a/gdb/testsuite/gdb.cp/ena-dis-br-range.exp
+++ b/gdb/testsuite/gdb.cp/ena-dis-br-range.exp
@@ -130,3 +130,41 @@ gdb_test_no_output "disable 2.8-6"
130130
131131 gdb_test "info break" [make_info_breakpoint_reply_re y y y y y y] \
132132 "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"