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

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