- Fix the watchpoints conditionals.

This commit is contained in:
Jan Kratochvil 2008-11-04 05:51:22 +00:00
parent 5c94ba08ee
commit e168686c08
3 changed files with 124 additions and 1 deletions

View File

@ -1678,3 +1678,41 @@ gdb/
/* Shared library handling. */
set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code);
set_solib_svr4_fetch_link_map_offsets
http://sourceware.org/ml/gdb-patches/2008-04/msg00379.html
http://sourceware.org/ml/gdb-cvs/2008-04/msg00104.html
2008-04-17 Marc Khouzam <marc.khouzam@ericsson.com>
* breakpoint.c (update_watchpoint): Always reparse
condition.
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.309
retrieving revision 1.310
diff -u -r1.309 -r1.310
--- src/gdb/breakpoint.c 2008/04/17 22:43:17 1.309
+++ src/gdb/breakpoint.c 2008/04/18 00:41:28 1.310
@@ -994,14 +994,13 @@
value_free (v);
}
- if (reparse && b->cond_string != NULL)
+ /* We just regenerated the list of breakpoint locations.
+ The new location does not have its condition field set to anything
+ and therefore, we must always reparse the cond_string, independently
+ of the value of the reparse flag. */
+ if (b->cond_string != NULL)
{
char *s = b->cond_string;
- if (b->loc->cond)
- {
- xfree (b->loc->cond);
- b->loc->cond = NULL;
- }
b->loc->cond = parse_exp_1 (&s, b->exp_valid_block, 0);
}
}

View File

@ -0,0 +1,78 @@
For:
http://sourceware.org/ml/gdb-patches/2008-04/msg00379.html
http://sourceware.org/ml/gdb-cvs/2008-04/msg00104.html
--- /dev/null 2008-11-04 06:31:10.599601840 +0100
+++ gdb-6.8/gdb/testsuite/gdb.base/watchpoint-cond.exp 2008-11-04 06:43:29.000000000 +0100
@@ -0,0 +1,37 @@
+# Copyright 2008 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-cond
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+
+# Get things started.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if { [runto_main] < 0 } {
+ untested watchpoint-cond
+ return -1
+}
+
+gdb_test "watch i if i < 20" "atchpoint \[0-9\]+: i"
+gdb_test "cont" "atchpoint \[0-9\]+: i.*Old value = 20.*New value = 19.*"
--- /dev/null 2008-11-04 06:31:10.599601840 +0100
+++ gdb-6.8/gdb/testsuite/gdb.base/watchpoint-cond.c 2008-11-04 06:42:48.000000000 +0100
@@ -0,0 +1,31 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008 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/>.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+int
+main (int argc, char **argv)
+{
+ int i = 0;
+ int j = 2;
+
+ for (j = 0; j < 30; j++)
+ i = 30 - j;
+
+ return 0;
+}

View File

@ -13,7 +13,7 @@ Version: 6.8
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 25%{?_with_upstream:.upstream}%{?dist}
Release: 26%{?_with_upstream:.upstream}%{?dist}
License: GPLv3+
Group: Development/Debuggers
@ -419,6 +419,9 @@ Patch337: gdb-6.8-attach-signalled-detach-stopped.patch
# Fix occasional crash on a removed watchpoint.
Patch338: gdb-6.8-breakpoint-gone.patch
# Test the watchpoints conditionals works.
Patch343: gdb-6.8-watchpoint-cond-test.patch
BuildRequires: ncurses-devel glibc-devel gcc make gzip texinfo dejagnu gettext
BuildRequires: flex bison sharutils expat-devel
Requires: readline
@ -621,6 +624,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch336 -p1
%patch337 -p1
%patch338 -p1
%patch343 -p1
%patch124 -p1
find -name "*.orig" | xargs rm -f
@ -884,6 +888,9 @@ fi
%endif
%changelog
* Tue Nov 4 2008 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.8-26
- Fix the watchpoints conditionals.
* Mon Nov 3 2008 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.8-25
- Fix the variable-length-arrays support (BZ 468266, feature BZ 377541).
- Fix the debuginfo-install suggestions for missing base packages (BZ 467901),