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

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