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
26bbde
Index: gdb-7.9.50.20150531/gdb/testsuite/gdb.base/fork-detach.c
26bbde
===================================================================
26bbde
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
26bbde
+++ gdb-7.9.50.20150531/gdb/testsuite/gdb.base/fork-detach.c	2015-05-31 18:23:49.008450716 +0200
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
+}
26bbde
Index: gdb-7.9.50.20150531/gdb/testsuite/gdb.base/fork-detach.exp
26bbde
===================================================================
26bbde
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
26bbde
+++ gdb-7.9.50.20150531/gdb/testsuite/gdb.base/fork-detach.exp	2015-05-31 18:23:49.008450716 +0200
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
26bbde
+set binfile ${objdir}/${subdir}/${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"
26bbde
Index: gdb-7.9.50.20150531/gdb/infrun.c
26bbde
===================================================================
26bbde
--- gdb-7.9.50.20150531.orig/gdb/infrun.c	2015-05-31 18:23:41.703405617 +0200
26bbde
+++ gdb-7.9.50.20150531/gdb/infrun.c	2015-05-31 18:23:49.011450735 +0200
26bbde
@@ -443,7 +443,7 @@ holding the child stopped.  Try \"set de
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));