Blame SOURCES/gdb-6.5-missed-trap-on-step-test.patch

a8223e
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
a8223e
From: Fedora GDB patches <invalid@email.com>
a8223e
Date: Fri, 27 Oct 2017 21:07:50 +0200
a8223e
Subject: gdb-6.5-missed-trap-on-step-test.patch
a8223e
a8223e
;; Test hiding unexpected breakpoints on intentional step commands.
a8223e
;;=fedoratest
a8223e
a8223e
Fix has been committed to:
a8223e
	gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch
a8223e
a8223e
diff --git a/gdb/testsuite/gdb.base/watchpoint-during-step.c b/gdb/testsuite/gdb.base/watchpoint-during-step.c
a8223e
new file mode 100644
a8223e
--- /dev/null
a8223e
+++ b/gdb/testsuite/gdb.base/watchpoint-during-step.c
a8223e
@@ -0,0 +1,30 @@
a8223e
+/* This testcase is part of GDB, the GNU debugger.
a8223e
+
a8223e
+   Copyright 2007 Free Software Foundation, Inc.
a8223e
+
a8223e
+   This program is free software; you can redistribute it and/or modify
a8223e
+   it under the terms of the GNU General Public License as published by
a8223e
+   the Free Software Foundation; either version 2 of the License, or
a8223e
+   (at your option) any later version.
a8223e
+
a8223e
+   This program is distributed in the hope that it will be useful,
a8223e
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
a8223e
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a8223e
+   GNU General Public License for more details.
a8223e
+
a8223e
+   You should have received a copy of the GNU General Public License
a8223e
+   along with this program; if not, write to the Free Software
a8223e
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
a8223e
+
a8223e
+   Please email any bugs, comments, and/or additions to this file to:
a8223e
+   bug-gdb@prep.ai.mit.edu  */
a8223e
+
a8223e
+static int var;
a8223e
+
a8223e
+int main()
a8223e
+{
a8223e
+  var = 1;
a8223e
+  var = 2;
a8223e
+  var = 3;
a8223e
+  return 0;
a8223e
+}
a8223e
diff --git a/gdb/testsuite/gdb.base/watchpoint-during-step.exp b/gdb/testsuite/gdb.base/watchpoint-during-step.exp
a8223e
new file mode 100644
a8223e
--- /dev/null
a8223e
+++ b/gdb/testsuite/gdb.base/watchpoint-during-step.exp
a8223e
@@ -0,0 +1,44 @@
a8223e
+# Copyright 2007 Free Software Foundation, Inc.
a8223e
+
a8223e
+# This program is free software; you can redistribute it and/or modify
a8223e
+# it under the terms of the GNU General Public License as published by
a8223e
+# the Free Software Foundation; either version 2 of the License, or
a8223e
+# (at your option) any later version.
a8223e
+#
a8223e
+# This program is distributed in the hope that it will be useful,
a8223e
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
a8223e
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a8223e
+# GNU General Public License for more details.
a8223e
+#
a8223e
+# You should have received a copy of the GNU General Public License
a8223e
+# along with this program; if not, write to the Free Software
a8223e
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
a8223e
+
a8223e
+set testfile watchpoint-during-step
a8223e
+set srcfile ${testfile}.c
a8223e
+set binfile [standard_output_file ${testfile}]
a8223e
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
a8223e
+    untested "Couldn't compile test program"
a8223e
+    return -1
a8223e
+}
a8223e
+
a8223e
+# Get things started.
a8223e
+
a8223e
+gdb_exit
a8223e
+gdb_start
a8223e
+gdb_reinitialize_dir $srcdir/$subdir
a8223e
+gdb_load ${binfile}
a8223e
+
a8223e
+runto_main
a8223e
+
a8223e
+gdb_breakpoint [gdb_get_line_number "var = 2"]
a8223e
+gdb_continue_to_breakpoint "Find the first var set"
a8223e
+
a8223e
+gdb_test "step" ".*var = 3;" "Step to the next var set"
a8223e
+
a8223e
+gdb_test "watch var" "atchpoint .*: var" "Set the watchpoint"
a8223e
+
a8223e
+# Here is the target point.  Be careful to not have breakpoint set on the line
a8223e
+# we step from as in this case it is a valid upstream KFAIL gdb/38
a8223e
+
a8223e
+gdb_test "step" ".*Old value = 2.*New value = 3.*" "Catch the watchpoint"