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