summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/annota1.c6
-rw-r--r--gdb/testsuite/gdb.base/annota1.exp48
2 files changed, 54 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/annota1.c b/gdb/testsuite/gdb.base/annota1.c
index 7d423e0960c..6a13ee9d53d 100644
--- a/gdb/testsuite/gdb.base/annota1.c
+++ b/gdb/testsuite/gdb.base/annota1.c
@@ -39,6 +39,12 @@ main ()
printf ("value is %d\n", value);
printf ("my_array[2] is %d\n", my_array[2]);
+
+ {
+ int i;
+ for (i = 0; i < 5; i++)
+ value++;
+ }
return 0;
}
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
index 5ecdcb37b84..9b4fce6f6fe 100644
--- a/gdb/testsuite/gdb.base/annota1.exp
+++ b/gdb/testsuite/gdb.base/annota1.exp
@@ -359,6 +359,54 @@ gdb_expect {
timeout { fail "re-run (timeout)" }
}
+#
+# Test that breakpoints-invalid is issued once and only once for
+# breakpoint ignore count changes, after annotation stopped.
+#
+send_gdb "break 46\n"
+gdb_expect {
+ -re "Breakpoint 5 at $hex: file .*$srcfile, line 46.*$gdb_prompt$" {
+ pass "break at 46"
+ }
+ -re ".*$gdb_prompt$" { fail "break at 46" }
+ timeout { fail "break at 46 (timeout)" }
+}
+
+send_gdb "ignore 5 4\n"
+gdb_expect {
+ -re "Will ignore next 4 crossings of breakpoint 5.*$gdb_prompt$" {
+ pass "ignore 5 4"
+ }
+ -re ".*$gdb_prompt$" { fail "ignore 5 4" }
+ timeout { fail "ignore 5 4 (timeout)" }
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re ".*$srcfile:46:.*\032\032stopped\r\n\r\n\032\032breakpoints-invalid\r\n$gdb_prompt$" {
+ pass "annotate ignore count change"
+ }
+ -re ".*$gdb_prompt$" { fail "annotate ignore count change" }
+ timeout { fail "annotate ignore count change (timeout)" }
+}
+
+# check that ignore command is working, or the above can provide
+# misleading assurance ...
+
+send_gdb "next\n"
+gdb_expect {
+ -re "$gdb_prompt$" {}
+ timeout { fail "next to exit loop" }
+}
+
+send_gdb "next\n"
+gdb_expect {
+ -re ".*$srcfile:49:.*$gdb_prompt$" {
+ pass "breakpoint ignore count"
+ }
+ -re ".*$gdb_prompt$" { fail "breakpoint ignore count" }
+ timeout { fail "breakpoint ignore count (timeout)" }
+}
#
# Send a signal that is not handled; test: