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