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

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