Blame SOURCES/gdb-6.6-bz235197-fork-detach-info.patch

e1d87d
2008-03-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
e1d87d
e1d87d
	Port to GDB-6.8pre.
e1d87d
	Remove the `[' character from the GDB-6.8 default message.
e1d87d
e1d87d
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.c
e1d87d
===================================================================
e1d87d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
e1d87d
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.c	2016-02-15 23:25:36.686600598 +0100
e1d87d
@@ -0,0 +1,57 @@
e1d87d
+/* This testcase is part of GDB, the GNU debugger.
e1d87d
+
e1d87d
+   Copyright 2007 Free Software Foundation, Inc.
e1d87d
+
e1d87d
+   This program is free software; you can redistribute it and/or modify
e1d87d
+   it under the terms of the GNU General Public License as published by
e1d87d
+   the Free Software Foundation; either version 2 of the License, or
e1d87d
+   (at your option) any later version.
e1d87d
+
e1d87d
+   This program is distributed in the hope that it will be useful,
e1d87d
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
e1d87d
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1d87d
+   GNU General Public License for more details.
e1d87d
+ 
e1d87d
+   You should have received a copy of the GNU General Public License
e1d87d
+   along with this program; if not, write to the Free Software
e1d87d
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
e1d87d
+
e1d87d
+   Please email any bugs, comments, and/or additions to this file to:
e1d87d
+   bug-gdb@prep.ai.mit.edu  */
e1d87d
+
e1d87d
+#include <sys/types.h>
e1d87d
+#include <sys/wait.h>
e1d87d
+#include <unistd.h>
e1d87d
+#include <assert.h>
e1d87d
+#include <stdlib.h>
e1d87d
+
e1d87d
+static void func (void)
e1d87d
+{
e1d87d
+}
e1d87d
+
e1d87d
+int main (void)
e1d87d
+{
e1d87d
+  pid_t child;
e1d87d
+
e1d87d
+  child = fork ();
e1d87d
+  switch (child)
e1d87d
+    {
e1d87d
+      case -1:
e1d87d
+	abort ();
e1d87d
+      case 0:
e1d87d
+	func ();
e1d87d
+	break;
e1d87d
+      default:
e1d87d
+        {
e1d87d
+/* We do not test the switching to the other fork by GDB `fork 1'.  */
e1d87d
+#if 0
e1d87d
+	  pid_t got;
e1d87d
+
e1d87d
+	  got = waitpid (child, NULL, 0);
e1d87d
+	  assert (got == child);
e1d87d
+#endif
e1d87d
+	  break;
e1d87d
+	}
e1d87d
+    }
e1d87d
+  return 0;
e1d87d
+}
e1d87d
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.exp
e1d87d
===================================================================
e1d87d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
e1d87d
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.exp	2016-02-15 23:27:55.792588265 +0100
e1d87d
@@ -0,0 +1,36 @@
e1d87d
+# Copyright 2007 Free Software Foundation, Inc.
e1d87d
+
e1d87d
+# This program is free software; you can redistribute it and/or modify
e1d87d
+# it under the terms of the GNU General Public License as published by
e1d87d
+# the Free Software Foundation; either version 2 of the License, or
e1d87d
+# (at your option) any later version.
e1d87d
+# 
e1d87d
+# This program is distributed in the hope that it will be useful,
e1d87d
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
e1d87d
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1d87d
+# GNU General Public License for more details.
e1d87d
+# 
e1d87d
+# You should have received a copy of the GNU General Public License
e1d87d
+# along with this program; if not, write to the Free Software
e1d87d
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
e1d87d
+
e1d87d
+set testfile fork-detach
e1d87d
+set srcfile ${testfile}.c
e1d87d
+set binfile [standard_output_file ${testfile}]
e1d87d
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
e1d87d
+    untested "Couldn't compile test program"
e1d87d
+    return -1
e1d87d
+}
e1d87d
+
e1d87d
+# Get things started.
e1d87d
+
e1d87d
+gdb_exit
e1d87d
+gdb_start
e1d87d
+gdb_reinitialize_dir $srcdir/$subdir
e1d87d
+gdb_load ${binfile}
e1d87d
+
e1d87d
+gdb_run_cmd
e1d87d
+# `Starting program: .*' prefix is available since gdb-6.7.
e1d87d
+gdb_test "" \
e1d87d
+         "Detaching after fork from child process.*\\\[Inferior .* exited normally\\\]" \
e1d87d
+         "Info message caught"
e1d87d
Index: gdb-7.10.90.20160211/gdb/infrun.c
e1d87d
===================================================================
e1d87d
--- gdb-7.10.90.20160211.orig/gdb/infrun.c	2016-02-15 23:25:01.432350289 +0100
e1d87d
+++ gdb-7.10.90.20160211/gdb/infrun.c	2016-02-15 23:27:49.274541986 +0100
e1d87d
@@ -478,7 +478,7 @@
e1d87d
 	      remove_breakpoints_pid (ptid_get_pid (inferior_ptid));
e1d87d
 	    }
e1d87d
 
e1d87d
-	  if (info_verbose || debug_infrun)
e1d87d
+	  if (1 /* Fedora Bug 235197 */ || info_verbose || debug_infrun)
e1d87d
 	    {
e1d87d
 	      /* Ensure that we have a process ptid.  */
e1d87d
 	      ptid_t process_ptid = pid_to_ptid (ptid_get_pid (child_ptid));
e1d87d
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/catch-syscall.exp
e1d87d
===================================================================
e1d87d
--- gdb-7.10.90.20160211.orig/gdb/testsuite/gdb.base/catch-syscall.exp	2016-02-15 23:25:01.432350289 +0100
e1d87d
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/catch-syscall.exp	2016-02-15 23:25:36.689600619 +0100
e1d87d
@@ -165,7 +165,7 @@
e1d87d
     # Deleting the catchpoints
e1d87d
     delete_breakpoints
e1d87d
 
e1d87d
-    gdb_continue_to_end
e1d87d
+    gdb_continue_to_end "" continue 1
e1d87d
 }
e1d87d
 
e1d87d
 proc test_catch_syscall_without_args {} {
e1d87d
@@ -236,7 +236,7 @@
e1d87d
 	# If it doesn't, everything is right (since we don't have
e1d87d
 	# a syscall named "mlock" in it).  Otherwise, this is a failure.
e1d87d
 	set thistest "catch syscall with unused syscall ($syscall_name)"
e1d87d
-	gdb_continue_to_end $thistest
e1d87d
+	gdb_continue_to_end $thistest continue 1
e1d87d
     }
e1d87d
 }
e1d87d