aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-03-28 20:19:02 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-03-28 20:19:02 +0000
commitd0fb5eaead43c6b5e73b113227b1be71c07fd213 (patch)
tree2231c45d70b956bc538f4231a45fa0fdb24ed053 /gdb/testsuite
parent20106cfbdb78a987e33d0ebc38946c01be275c26 (diff)
downloadgdb-d0fb5eaead43c6b5e73b113227b1be71c07fd213.zip
gdb-d0fb5eaead43c6b5e73b113227b1be71c07fd213.tar.gz
gdb-d0fb5eaead43c6b5e73b113227b1be71c07fd213.tar.bz2
gdb/
Support a ring of related breakpoints. * breakpoint.c (watchpoint_del_at_next_stop): New, move here code from other functions, add gdb_assert. (update_watchpoint, watchpoint_check): Add gdb_assert. Use watchpoint_del_at_next_stop. (bpstat_check_watchpoint): Use watchpoint_del_at_next_stop. (bpstat_stop_status): Handle ring in related_breakpoint. (set_raw_breakpoint_without_location): Initialize ring in related_breakpoint. (delete_breakpoint): Handle ring in related_breakpoint, use watchpoint_del_at_next_stop. (map_breakpoint_numbers): Handle ring in related_breakpoint. gdb/testsuite/ Support a ring of related breakpoints. * gdb.base/watchpoint-delete.c: New file. * gdb.base/watchpoint-delete.exp: New file.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.base/watchpoint-delete.c33
-rw-r--r--gdb/testsuite/gdb.base/watchpoint-delete.exp38
3 files changed, 77 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index defd8c7..04c20dd 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2011-03-28 Jan Kratochvil <jan.kratochvil@redhat.com>
+ Support a ring of related breakpoints.
+ * gdb.base/watchpoint-delete.c: New file.
+ * gdb.base/watchpoint-delete.exp: New file.
+
+2011-03-28 Jan Kratochvil <jan.kratochvil@redhat.com>
+
* gdb.ada/arrayparam.exp (print first after function call): Use
explicit package name. Add a comment
(print lasta after function call): Rename ...
diff --git a/gdb/testsuite/gdb.base/watchpoint-delete.c b/gdb/testsuite/gdb.base/watchpoint-delete.c
new file mode 100644
index 0000000..20c9929
--- /dev/null
+++ b/gdb/testsuite/gdb.base/watchpoint-delete.c
@@ -0,0 +1,33 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010, 2011 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+void
+func (void)
+{
+ volatile int x = 0;
+
+ x++; /* break-here */
+ x++;
+}
+
+int
+main (void)
+{
+ func ();
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/watchpoint-delete.exp b/gdb/testsuite/gdb.base/watchpoint-delete.exp
new file mode 100644
index 0000000..7aadf4e
--- /dev/null
+++ b/gdb/testsuite/gdb.base/watchpoint-delete.exp
@@ -0,0 +1,38 @@
+# Copyright 2010, 2011 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set testfile "watchpoint-delete"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
+ untested ${testfile}.exp
+ return -1
+}
+
+# It is more compatible this way.
+gdb_test_no_output "set can-use-hw-watchpoints 0"
+
+if ![runto_main] {
+ return -1
+}
+
+# Ensure there is a parent frame to create related bp_watchpoint_scope.
+gdb_breakpoint [gdb_get_line_number "break-here"]
+gdb_continue_to_breakpoint "break-here" ".* break-here .*"
+
+gdb_test "watch x" {Watchpoint [0-9]+: x}
+
+gdb_test_no_output {delete $bpnum}