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

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