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

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