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