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

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