1 commit 30fedadf224a8c119575fcc8a6ced51f0d4aee9f
2 Author: Jan Kratochvil <jan.kratochvil@redhat.com>
3 Date: Wed Sep 29 01:25:39 2010 +0200
7 commit d101ce597f2d6143e9f023a4444352bceffb2679
8 Author: Jan Kratochvil <jan.kratochvil@redhat.com>
9 Date: Wed Sep 29 00:42:37 2010 +0200
11 New testcase for: https://bugzilla.redhat.com/show_bug.cgi?id=637770
13 diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
14 index de51231..18b7868 100644
15 --- a/gdb/breakpoint.c
16 +++ b/gdb/breakpoint.c
17 @@ -10560,6 +10560,11 @@ map_breakpoint_numbers (char *args, void (*function) (struct breakpoint *,
18 /* FUNCTION can be also delete_breakpoint. */
19 next_related_b = related_breakpoint->related_breakpoint;
20 function (related_breakpoint, data);
22 + /* For delete_breakpoint of the last entry of the ring we
23 + were traversing we would never get back to B. */
24 + if (next_related_b == related_breakpoint)
26 related_breakpoint = next_related_b;
28 while (related_breakpoint != b);
29 diff --git a/gdb/testsuite/gdb.base/watchpoint-delete.c b/gdb/testsuite/gdb.base/watchpoint-delete.c
31 index 0000000..031ef92
33 +++ b/gdb/testsuite/gdb.base/watchpoint-delete.c
35 +/* This testcase is part of GDB, the GNU debugger.
37 + Copyright 2010 Free Software Foundation, Inc.
39 + This program is free software; you can redistribute it and/or modify
40 + it under the terms of the GNU General Public License as published by
41 + the Free Software Foundation; either version 3 of the License, or
42 + (at your option) any later version.
44 + This program is distributed in the hope that it will be useful,
45 + but WITHOUT ANY WARRANTY; without even the implied warranty of
46 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47 + GNU General Public License for more details.
49 + You should have received a copy of the GNU General Public License
50 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
57 + x++; /* break-here */
68 diff --git a/gdb/testsuite/gdb.base/watchpoint-delete.exp b/gdb/testsuite/gdb.base/watchpoint-delete.exp
70 index 0000000..45bc650
72 +++ b/gdb/testsuite/gdb.base/watchpoint-delete.exp
74 +# Copyright 2010 Free Software Foundation, Inc.
76 +# This program is free software; you can redistribute it and/or modify
77 +# it under the terms of the GNU General Public License as published by
78 +# the Free Software Foundation; either version 3 of the License, or
79 +# (at your option) any later version.
81 +# This program is distributed in the hope that it will be useful,
82 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
83 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
84 +# GNU General Public License for more details.
86 +# You should have received a copy of the GNU General Public License
87 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
89 +set testfile "watchpoint-delete"
90 +set srcfile ${testfile}.c
91 +set binfile ${objdir}/${subdir}/${testfile}
93 +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
94 + untested ${testfile}.exp
98 +# It is more compatible this way.
99 +gdb_test_no_output "set can-use-hw-watchpoints 0"
105 +# Ensure there is a parent frame to create related bp_watchpoint_scope.
106 +gdb_breakpoint [gdb_get_line_number "break-here"]
107 +gdb_continue_to_breakpoint "break-here" ".* break-here .*"
109 +gdb_test "watch x" {Watchpoint [0-9]+: x}
111 +gdb_test_no_output {delete $bpnum}