]>
Commit | Line | Data |
---|---|---|
51a5ef0f PS |
1 | commit 30fedadf224a8c119575fcc8a6ced51f0d4aee9f |
2 | Author: Jan Kratochvil <jan.kratochvil@redhat.com> | |
3 | Date: Wed Sep 29 01:25:39 2010 +0200 | |
4 | ||
5 | Fix the crash. | |
6 | ||
7 | commit d101ce597f2d6143e9f023a4444352bceffb2679 | |
8 | Author: Jan Kratochvil <jan.kratochvil@redhat.com> | |
9 | Date: Wed Sep 29 00:42:37 2010 +0200 | |
10 | ||
11 | New testcase for: https://bugzilla.redhat.com/show_bug.cgi?id=637770 | |
12 | ||
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); | |
21 | + | |
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) | |
25 | + break; | |
26 | related_breakpoint = next_related_b; | |
27 | } | |
28 | while (related_breakpoint != b); | |
29 | diff --git a/gdb/testsuite/gdb.base/watchpoint-delete.c b/gdb/testsuite/gdb.base/watchpoint-delete.c | |
30 | new file mode 100644 | |
31 | index 0000000..031ef92 | |
32 | --- /dev/null | |
33 | +++ b/gdb/testsuite/gdb.base/watchpoint-delete.c | |
34 | @@ -0,0 +1,33 @@ | |
35 | +/* This testcase is part of GDB, the GNU debugger. | |
36 | + | |
37 | + Copyright 2010 Free Software Foundation, Inc. | |
38 | + | |
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. | |
43 | + | |
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. | |
48 | + | |
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/>. */ | |
51 | + | |
52 | +void | |
53 | +func (void) | |
54 | +{ | |
55 | + volatile int x = 0; | |
56 | + | |
57 | + x++; /* break-here */ | |
58 | + x++; | |
59 | +} | |
60 | + | |
61 | +int | |
62 | +main (void) | |
63 | +{ | |
64 | + func (); | |
65 | + | |
66 | + return 0; | |
67 | +} | |
68 | diff --git a/gdb/testsuite/gdb.base/watchpoint-delete.exp b/gdb/testsuite/gdb.base/watchpoint-delete.exp | |
69 | new file mode 100644 | |
70 | index 0000000..45bc650 | |
71 | --- /dev/null | |
72 | +++ b/gdb/testsuite/gdb.base/watchpoint-delete.exp | |
73 | @@ -0,0 +1,38 @@ | |
74 | +# Copyright 2010 Free Software Foundation, Inc. | |
75 | + | |
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. | |
80 | +# | |
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. | |
85 | +# | |
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/>. | |
88 | + | |
89 | +set testfile "watchpoint-delete" | |
90 | +set srcfile ${testfile}.c | |
91 | +set binfile ${objdir}/${subdir}/${testfile} | |
92 | + | |
93 | +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { | |
94 | + untested ${testfile}.exp | |
95 | + return -1 | |
96 | +} | |
97 | + | |
98 | +# It is more compatible this way. | |
99 | +gdb_test_no_output "set can-use-hw-watchpoints 0" | |
100 | + | |
101 | +if ![runto_main] { | |
102 | + return -1 | |
103 | +} | |
104 | + | |
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 .*" | |
108 | + | |
109 | +gdb_test "watch x" {Watchpoint [0-9]+: x} | |
110 | + | |
111 | +gdb_test_no_output {delete $bpnum} |