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
Jan Kratochvil 23f398e
Index: gdb-7.10.50.20151027/gdb/testsuite/gdb.base/fork-detach.c
25ff8a1
===================================================================
25ff8a1
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
Jan Kratochvil 23f398e
+++ gdb-7.10.50.20151027/gdb/testsuite/gdb.base/fork-detach.c	2015-10-27 22:38:46.693459569 +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
+}
Jan Kratochvil 23f398e
Index: gdb-7.10.50.20151027/gdb/testsuite/gdb.base/fork-detach.exp
25ff8a1
===================================================================
25ff8a1
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
Jan Kratochvil 23f398e
+++ gdb-7.10.50.20151027/gdb/testsuite/gdb.base/fork-detach.exp	2015-10-27 22:38:46.693459569 +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 "" \
Jan Kratochvil 48cf710
+         "Detaching after fork from child process.*\\\[Inferior .* exited normally\\\]" \
4b94240
+         "Info message caught"
Jan Kratochvil 23f398e
Index: gdb-7.10.50.20151027/gdb/infrun.c
Jan Kratochvil 2f7f533
===================================================================
Jan Kratochvil 23f398e
--- gdb-7.10.50.20151027.orig/gdb/infrun.c	2015-10-27 22:38:34.333386939 +0100
Jan Kratochvil 23f398e
+++ gdb-7.10.50.20151027/gdb/infrun.c	2015-10-27 22:38:46.695459581 +0100
Jan Kratochvil 23f398e
@@ -477,7 +477,7 @@ holding the child stopped.  Try \"set de
Jan Kratochvil 2f7f533
 	      remove_breakpoints_pid (ptid_get_pid (inferior_ptid));
Jan Kratochvil 2f7f533
 	    }
Jan Kratochvil 2f7f533
 
Jan Kratochvil 2f7f533
-	  if (info_verbose || debug_infrun)
Jan Kratochvil 2f7f533
+	  if (1 /* Fedora Bug 235197 */ || info_verbose || debug_infrun)
Jan Kratochvil 2f7f533
 	    {
Jan Kratochvil 32f92b2
 	      /* Ensure that we have a process ptid.  */
Jan Kratochvil 32f92b2
 	      ptid_t process_ptid = pid_to_ptid (ptid_get_pid (child_ptid));
Jan Kratochvil 23f398e
Index: gdb-7.10.50.20151027/gdb/testsuite/gdb.base/catch-syscall.exp
Jan Kratochvil 23f398e
===================================================================
Jan Kratochvil 23f398e
--- gdb-7.10.50.20151027.orig/gdb/testsuite/gdb.base/catch-syscall.exp	2015-10-27 22:43:47.015224320 +0100
Jan Kratochvil 23f398e
+++ gdb-7.10.50.20151027/gdb/testsuite/gdb.base/catch-syscall.exp	2015-10-27 22:44:29.327472955 +0100
Jan Kratochvil 23f398e
@@ -165,7 +165,7 @@ proc check_for_program_end {} {
Jan Kratochvil 23f398e
     # Deleting the catchpoints
Jan Kratochvil 23f398e
     delete_breakpoints
Jan Kratochvil 23f398e
 
Jan Kratochvil 23f398e
-    gdb_continue_to_end
Jan Kratochvil 23f398e
+    gdb_continue_to_end "" continue 1
Jan Kratochvil 23f398e
 }
Jan Kratochvil 23f398e
 
Jan Kratochvil 23f398e
 proc test_catch_syscall_without_args {} {
Jan Kratochvil 23f398e
@@ -236,7 +236,7 @@ proc test_catch_syscall_with_wrong_args
Jan Kratochvil 23f398e
 	# If it doesn't, everything is right (since we don't have
Jan Kratochvil 23f398e
 	# a syscall named "mlock" in it).  Otherwise, this is a failure.
Jan Kratochvil 23f398e
 	set thistest "catch syscall with unused syscall ($syscall_name)"
Jan Kratochvil 23f398e
-	gdb_continue_to_end $thistest
Jan Kratochvil 23f398e
+	gdb_continue_to_end $thistest continue 1
Jan Kratochvil 23f398e
     }
Jan Kratochvil 23f398e
 }
Jan Kratochvil 23f398e