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

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