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