Blame SOURCES/gdb-6.8-watchpoint-conditionals-test.patch

2c2fa1
For:
2c2fa1
http://sourceware.org/ml/gdb-patches/2008-04/msg00379.html
2c2fa1
http://sourceware.org/ml/gdb-cvs/2008-04/msg00104.html
2c2fa1
2c2fa1
--- /dev/null	2008-11-04 06:31:10.599601840 +0100
2c2fa1
+++ gdb-6.8/gdb/testsuite/gdb.base/watchpoint-cond.exp	2008-11-04 06:43:29.000000000 +0100
2c2fa1
@@ -0,0 +1,37 @@
2c2fa1
+# Copyright 2008 Free Software Foundation, Inc.
2c2fa1
+
2c2fa1
+# This program is free software; you can redistribute it and/or modify
2c2fa1
+# it under the terms of the GNU General Public License as published by
2c2fa1
+# the Free Software Foundation; either version 3 of the License, or
2c2fa1
+# (at your option) any later version.
2c2fa1
+#
2c2fa1
+# This program is distributed in the hope that it will be useful,
2c2fa1
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
2c2fa1
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2c2fa1
+# GNU General Public License for more details.
2c2fa1
+#
2c2fa1
+# You should have received a copy of the GNU General Public License
2c2fa1
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
2c2fa1
+
2c2fa1
+set testfile watchpoint-cond
2c2fa1
+set srcfile ${testfile}.c
2c2fa1
+set binfile ${objdir}/${subdir}/${testfile}
2c2fa1
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
2c2fa1
+    untested "Couldn't compile test program"
2c2fa1
+    return -1
2c2fa1
+}
2c2fa1
+
2c2fa1
+# Get things started.
2c2fa1
+
2c2fa1
+gdb_exit
2c2fa1
+gdb_start
2c2fa1
+gdb_reinitialize_dir $srcdir/$subdir
2c2fa1
+gdb_load ${binfile}
2c2fa1
+
2c2fa1
+if { [runto_main] < 0 } {
2c2fa1
+    untested watchpoint-cond
2c2fa1
+    return -1
2c2fa1
+}
2c2fa1
+
2c2fa1
+gdb_test "watch i if i < 20" "atchpoint \[0-9\]+: i"
2c2fa1
+gdb_test "cont" "atchpoint \[0-9\]+: i.*Old value = 20.*New value = 19.*"
2c2fa1
--- /dev/null	2008-11-04 06:31:10.599601840 +0100
2c2fa1
+++ gdb-6.8/gdb/testsuite/gdb.base/watchpoint-cond.c	2008-11-04 06:42:48.000000000 +0100
2c2fa1
@@ -0,0 +1,31 @@
2c2fa1
+/* This testcase is part of GDB, the GNU debugger.
2c2fa1
+
2c2fa1
+   Copyright 2008 Free Software Foundation, Inc.
2c2fa1
+
2c2fa1
+   This program is free software; you can redistribute it and/or modify
2c2fa1
+   it under the terms of the GNU General Public License as published by
2c2fa1
+   the Free Software Foundation; either version 3 of the License, or
2c2fa1
+   (at your option) any later version.
2c2fa1
+
2c2fa1
+   This program is distributed in the hope that it will be useful,
2c2fa1
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
2c2fa1
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2c2fa1
+   GNU General Public License for more details.
2c2fa1
+
2c2fa1
+   You should have received a copy of the GNU General Public License
2c2fa1
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
2c2fa1
+
2c2fa1
+   Please email any bugs, comments, and/or additions to this file to:
2c2fa1
+   bug-gdb@prep.ai.mit.edu  */
2c2fa1
+
2c2fa1
+int
2c2fa1
+main (int argc, char **argv)
2c2fa1
+{
2c2fa1
+  static int i = 0; /* `static' to start initialized.  */
2c2fa1
+  int j = 2;
2c2fa1
+
2c2fa1
+  for (j = 0; j < 30; j++)
2c2fa1
+    i = 30 - j;
2c2fa1
+
2c2fa1
+  return 0;
2c2fa1
+}