aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2014-09-16 14:05:06 +0100
committerPedro Alves <palves@redhat.com>2014-09-16 14:05:06 +0100
commit7280ceea02b97b2da8744b46edf6dab3429c3396 (patch)
tree27dfa643f1d01b735dd77175caae1a161f5e8aab /gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.c
parent05db5edd7923711a20c6225ea8e15f36e819d140 (diff)
downloadbinutils-7280ceea02b97b2da8744b46edf6dab3429c3396.zip
binutils-7280ceea02b97b2da8744b46edf6dab3429c3396.tar.gz
binutils-7280ceea02b97b2da8744b46edf6dab3429c3396.tar.bz2
Add test to make sure GDB knows which "kind" of watchpoint the target has
This adds a test that makes sure GDB knows whether the target has continuable, or non-continuable watchpoints. That is, the test confirms that GDB presents a watchpoint value change at the first instruction right after the instruction that changes memory. gdb/testsuite/ChangeLog: 2014-09-16 Pedro Alves <palves@redhat.com> * gdb.base/watchpoint-stops-at-right-insn.c: New file. * gdb.base/watchpoint-stops-at-right-insn.exp: New file.
Diffstat (limited to 'gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.c')
-rw-r--r--gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.c b/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.c
new file mode 100644
index 0000000..005d63f
--- /dev/null
+++ b/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.c
@@ -0,0 +1,33 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2014 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+volatile int global;
+
+void
+set_global (int val)
+{
+ global = val;
+}
+
+int
+main (void)
+{
+ set_global (1);
+ set_global (2);
+
+ return 0;
+}