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

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