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
2f7f533
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/fork-detach.c
25ff8a1
===================================================================
25ff8a1
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
2f7f533
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.base/fork-detach.c	2015-01-06 19:31:40.703988534 +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
+}
2f7f533
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/fork-detach.exp
25ff8a1
===================================================================
25ff8a1
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
2f7f533
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.base/fork-detach.exp	2015-01-06 19:31:40.704988538 +0100
dd46ae6
@@ -0,0 +1,36 @@
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
+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 "" \
48cf710
+         "Detaching after fork from child process.*\\\[Inferior .* exited normally\\\]" \
4b94240
+         "Info message caught"
2f7f533
Index: gdb-7.8.50.20141228/gdb/infrun.c
2f7f533
===================================================================
2f7f533
--- gdb-7.8.50.20141228.orig/gdb/infrun.c	2015-01-06 19:31:40.262986644 +0100
2f7f533
+++ gdb-7.8.50.20141228/gdb/infrun.c	2015-01-06 19:43:54.865219096 +0100
2f7f533
@@ -456,7 +456,7 @@ holding the child stopped.  Try \"set de
2f7f533
 	      remove_breakpoints_pid (ptid_get_pid (inferior_ptid));
2f7f533
 	    }
2f7f533
 
2f7f533
-	  if (info_verbose || debug_infrun)
2f7f533
+	  if (1 /* Fedora Bug 235197 */ || info_verbose || debug_infrun)
2f7f533
 	    {
2f7f533
 	      target_terminal_ours_for_output ();
2f7f533
 	      fprintf_filtered (gdb_stdlog,