Blame SOURCES/gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch

e1d87d
Index: gdb-7.6.1/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp
e1d87d
===================================================================
e1d87d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
e1d87d
+++ gdb-7.6.1/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp	2016-03-10 22:31:31.152094080 +0100
e1d87d
@@ -0,0 +1,53 @@
e1d87d
+# Copyright (C) 2016 Free Software Foundation, Inc.
e1d87d
+
e1d87d
+# This program is free software; you can redistribute it and/or modify
e1d87d
+# it under the terms of the GNU General Public License as published by
e1d87d
+# the Free Software Foundation; either version 3 of the License, or
e1d87d
+# (at your option) any later version.
e1d87d
+#
e1d87d
+# This program is distributed in the hope that it will be useful,
e1d87d
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
e1d87d
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1d87d
+# GNU General Public License for more details.
e1d87d
+#
e1d87d
+# You should have received a copy of the GNU General Public License
e1d87d
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
e1d87d
+
e1d87d
+if { [prepare_for_testing rhbz1261564-aarch64-watchpoint.exp "rhbz1261564-aarch64-watchpoint"] } {
e1d87d
+    return -1
e1d87d
+}
e1d87d
+
e1d87d
+if { ! [ runto main ] } then { return 0 }
e1d87d
+
e1d87d
+set test "rwatch aligned.var4"
e1d87d
+if [istarget "s390*-*-*"] {
e1d87d
+    gdb_test $test {Target does not support this type of hardware watchpoint\.}
e1d87d
+    untested "s390* does not support hw read watchpoint" 
e1d87d
+    return
e1d87d
+}
e1d87d
+gdb_test $test "Hardware read watchpoint \[0-9\]+: aligned.var4"
e1d87d
+
e1d87d
+proc checkvar { address } {
e1d87d
+    global gdb_prompt
e1d87d
+
e1d87d
+    set test "p &aligned.var$address"
e1d87d
+    gdb_test_multiple $test $test {
e1d87d
+	-re " = \\(int \\*\\) 0x\[0-9a-f\]+$address <aligned(\\+\[0-9\]+)?>\r\n$gdb_prompt $" {
e1d87d
+	    pass $test
e1d87d
+	}
e1d87d
+	-re "\r\n$gdb_prompt $" {
e1d87d
+	    untested "$test (unexpected ELF layout)"
e1d87d
+	    return 0
e1d87d
+	}
e1d87d
+    }
e1d87d
+    return 1
e1d87d
+}
e1d87d
+if ![checkvar "0"] { return }
e1d87d
+if ![checkvar "4"] { return }
e1d87d
+if ![checkvar "8"] { return }
e1d87d
+
e1d87d
+# Assumes: PPC_PTRACE_GETHWDBGINFO::data_bp_alignment == 8
e1d87d
+# 'lwz' does read only 4 bytes but the hw watchpoint is 8 bytes wide.
e1d87d
+setup_xfail "powerpc*-*-*"
e1d87d
+
e1d87d
+gdb_continue_to_end
e1d87d
Index: gdb-7.6.1/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c
e1d87d
===================================================================
e1d87d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
e1d87d
+++ gdb-7.6.1/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c	2016-03-10 22:31:31.152094080 +0100
e1d87d
@@ -0,0 +1,33 @@
e1d87d
+/* This testcase is part of GDB, the GNU debugger.
e1d87d
+
e1d87d
+   Copyright 2016 Free Software Foundation, Inc.
e1d87d
+
e1d87d
+   This program is free software; you can redistribute it and/or modify
e1d87d
+   it under the terms of the GNU General Public License as published by
e1d87d
+   the Free Software Foundation; either version 3 of the License, or
e1d87d
+   (at your option) any later version.
e1d87d
+
e1d87d
+   This program is distributed in the hope that it will be useful,
e1d87d
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
e1d87d
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1d87d
+   GNU General Public License for more details.
e1d87d
+
e1d87d
+   You should have received a copy of the GNU General Public License
e1d87d
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
e1d87d
+
e1d87d
+__attribute__((aligned(16))) struct
e1d87d
+{
e1d87d
+  int var0, var4, var8;
e1d87d
+} aligned;
e1d87d
+
e1d87d
+int
e1d87d
+main (void)
e1d87d
+{
e1d87d
+  aligned.var0 = 1;
e1d87d
+  aligned.var4 = 2;
e1d87d
+  aligned.var8 = 3;
e1d87d
+
e1d87d
+  aligned.var4 = aligned.var0;
e1d87d
+
e1d87d
+  return 0;
e1d87d
+}