rpms/gdb/devel gdb-6.3-watchpoint-cond-gone-test.patch, NONE, 1.1 gdb.spec, 1.278, 1.279

Jan Kratochvil (jkratoch) fedora-extras-commits at redhat.com
Sun Apr 6 01:40:47 UTC 2008


Author: jkratoch

Update of /cvs/pkgs/rpms/gdb/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27584

Modified Files:
	gdb.spec 
Added Files:
	gdb-6.3-watchpoint-cond-gone-test.patch 
Log Message:
* Sun Mar 30 2008 Jan Kratochvil <jan.kratochvil at redhat.com> - 6.8-1postcvs
- Test crash on a sw watchpoint condition getting out of the scope.


gdb-6.3-watchpoint-cond-gone-test.patch:

--- NEW FILE gdb-6.3-watchpoint-cond-gone-test.patch ---
--- /dev/null	2008-04-03 00:39:30.714021604 +0200
+++ gdb-6.3/gdb/testsuite/gdb.base/watchpoint-cond-gone-stripped.c	2008-04-05 20:26:29.000000000 +0200
@@ -0,0 +1,23 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2008 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+ 
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+void
+jumper (void (*jumpto) (void))
+{
+  (*jumpto) ();
+}
--- /dev/null	2008-04-03 00:39:30.714021604 +0200
+++ gdb-6.3/gdb/testsuite/gdb.base/watchpoint-cond-gone.c	2008-04-05 20:26:48.000000000 +0200
@@ -0,0 +1,37 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2008 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+ 
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+extern void jumper (void (*jumpto) (void));
+
+void
+func ()
+{
+	int a, b, c;
+
+	a = b = c = 5;
+	a = b = c = 10;	/* watchpoint-here */
+	c = a + b;
+}
+
+int
+main ()
+{
+	jumper (func);
+
+	return 0;
+}
--- /dev/null	2008-04-03 00:39:30.714021604 +0200
+++ gdb-6.3/gdb/testsuite/gdb.base/watchpoint-cond-gone.exp	2008-04-05 20:33:19.000000000 +0200
@@ -0,0 +1,59 @@
+# Copyright 2008 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+if $tracelevel then {
+    strace $tracelevel
+}
+
+set testfile "watchpoint-cond-gone"
+set srcfile ${testfile}.c
+set srcfilestripped ${testfile}-stripped.c
+set objfilestripped ${objdir}/${subdir}/${testfile}-stripped.o
+set binfile ${objdir}/${subdir}/${testfile}
+
+# We need to generate a function without DWARF to crash older GDB.
+# Stepping into a dynamic function trampoline or stepping out of MAIN may work
+# but it is not a reliable FAIL case.
+
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfilestripped}" "${objfilestripped}" object {}] != "" } {
+    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${objfilestripped}" "${binfile}" executable {debug}] != "" } {
+    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Problem does not occur otherwise.
+gdb_test "set can-use-hw-watchpoints 0"
+
+runto_main
+gdb_breakpoint [gdb_get_line_number "watchpoint-here"]
+gdb_continue_to_breakpoint "Place to set the watchpoint"
+
+# The condition `c == 30' is the tested culprit.
+gdb_test "watch c if c == 30" "" "Place the watchpoint"
+
+# No functionality, just to check the state.
+gdb_test "backtrace"
+
+gdb_test "finish" \
+         "Watchpoint .* deleted because the program has left the block in.*which its expression is valid..*in jumper.*" \
+         "Catch the no longer valid watchpoint"


Index: gdb.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb.spec,v
retrieving revision 1.278
retrieving revision 1.279
diff -u -r1.278 -r1.279
--- gdb.spec	30 Mar 2008 22:15:14 -0000	1.278
+++ gdb.spec	6 Apr 2008 01:40:10 -0000	1.279
@@ -349,6 +349,9 @@
 # Test a crash on `focus cmd', `focus prev' commands.
 Patch311: gdb-6.3-focus-cmd-prev-test.patch
 
+# Test crash on a sw watchpoint condition getting out of the scope.
+Patch314: gdb-6.3-watchpoint-cond-gone-test.patch
+
 BuildRequires: ncurses-devel glibc-devel gcc make gzip texinfo dejagnu gettext
 BuildRequires: flex bison sharutils expat-devel
 Requires: readline
@@ -514,6 +517,7 @@
 %patch306 -p1
 %patch309 -p1
 %patch311 -p1
+%patch314 -p1
 
 find -name "*.orig" | xargs rm -f
 ! find -name "*.rej"	# Should not happen.
@@ -759,6 +763,7 @@
 - New test of GCORE for shmid 0 shared memory mappings.
 - New test of a crash on `focus cmd', `focus prev' commands.
 - Fix a minor test race of the hardware watchpoints after the fork call.
+- Test crash on a sw watchpoint condition getting out of the scope.
 
 * Fri Mar 28 2008 Jan Kratochvil <jan.kratochvil at redhat.com> - 6.8-1
 - Upgrade to the latest upstream final release gdb-6.8.




More information about the fedora-extras-commits mailing list