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

861f93
2008-03-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
861f93
861f93
	Port to GDB-6.8pre.
861f93
	Remove the `[' character from the GDB-6.8 default message.
861f93
861f93
Index: gdb-7.2.50.20110320/gdb/linux-nat.c
861f93
===================================================================
861f93
--- gdb-7.2.50.20110320.orig/gdb/linux-nat.c	2011-03-20 16:59:51.000000000 +0100
861f93
+++ gdb-7.2.50.20110320/gdb/linux-nat.c	2011-03-20 16:59:51.000000000 +0100
861f93
@@ -716,7 +716,7 @@ holding the child stopped.  Try \"set de
861f93
 	      remove_breakpoints_pid (GET_PID (inferior_ptid));
861f93
 	    }
861f93
 
861f93
-	  if (info_verbose || debug_linux_nat)
861f93
+	  if (1 /* Fedora Bug 235197 */ || info_verbose || debug_linux_nat)
861f93
 	    {
861f93
 	      target_terminal_ours ();
861f93
 	      fprintf_filtered (gdb_stdlog,
861f93
Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.c
861f93
===================================================================
861f93
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
861f93
+++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.c	2011-03-20 16:59:51.000000000 +0100
861f93
@@ -0,0 +1,57 @@
861f93
+/* This testcase is part of GDB, the GNU debugger.
861f93
+
861f93
+   Copyright 2007 Free Software Foundation, Inc.
861f93
+
861f93
+   This program is free software; you can redistribute it and/or modify
861f93
+   it under the terms of the GNU General Public License as published by
861f93
+   the Free Software Foundation; either version 2 of the License, or
861f93
+   (at your option) any later version.
861f93
+
861f93
+   This program is distributed in the hope that it will be useful,
861f93
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
861f93
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
861f93
+   GNU General Public License for more details.
861f93
+ 
861f93
+   You should have received a copy of the GNU General Public License
861f93
+   along with this program; if not, write to the Free Software
861f93
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
861f93
+
861f93
+   Please email any bugs, comments, and/or additions to this file to:
861f93
+   bug-gdb@prep.ai.mit.edu  */
861f93
+
861f93
+#include <sys/types.h>
861f93
+#include <sys/wait.h>
861f93
+#include <unistd.h>
861f93
+#include <assert.h>
861f93
+#include <stdlib.h>
861f93
+
861f93
+static void func (void)
861f93
+{
861f93
+}
861f93
+
861f93
+int main (void)
861f93
+{
861f93
+  pid_t child;
861f93
+
861f93
+  child = fork ();
861f93
+  switch (child)
861f93
+    {
861f93
+      case -1:
861f93
+	abort ();
861f93
+      case 0:
861f93
+	func ();
861f93
+	break;
861f93
+      default:
861f93
+        {
861f93
+/* We do not test the switching to the other fork by GDB `fork 1'.  */
861f93
+#if 0
861f93
+	  pid_t got;
861f93
+
861f93
+	  got = waitpid (child, NULL, 0);
861f93
+	  assert (got == child);
861f93
+#endif
861f93
+	  break;
861f93
+	}
861f93
+    }
861f93
+  return 0;
861f93
+}
861f93
Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.exp
861f93
===================================================================
861f93
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
861f93
+++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.exp	2011-03-20 17:12:22.000000000 +0100
861f93
@@ -0,0 +1,36 @@
861f93
+# Copyright 2007 Free Software Foundation, Inc.
861f93
+
861f93
+# This program is free software; you can redistribute it and/or modify
861f93
+# it under the terms of the GNU General Public License as published by
861f93
+# the Free Software Foundation; either version 2 of the License, or
861f93
+# (at your option) any later version.
861f93
+# 
861f93
+# This program is distributed in the hope that it will be useful,
861f93
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
861f93
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
861f93
+# GNU General Public License for more details.
861f93
+# 
861f93
+# You should have received a copy of the GNU General Public License
861f93
+# along with this program; if not, write to the Free Software
861f93
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
861f93
+
861f93
+set testfile fork-detach
861f93
+set srcfile ${testfile}.c
861f93
+set binfile ${objdir}/${subdir}/${testfile}
861f93
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
861f93
+    untested "Couldn't compile test program"
861f93
+    return -1
861f93
+}
861f93
+
861f93
+# Get things started.
861f93
+
861f93
+gdb_exit
861f93
+gdb_start
861f93
+gdb_reinitialize_dir $srcdir/$subdir
861f93
+gdb_load ${binfile}
861f93
+
861f93
+gdb_run_cmd
861f93
+# `Starting program: .*' prefix is available since gdb-6.7.
861f93
+gdb_test "" \
861f93
+         "Detaching after fork from child process.*\\\[Inferior .* exited normally\\\]" \
861f93
+         "Info message caught"