2008-03-03 16:13:47 +00:00
|
|
|
2008-03-01 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
Port to GDB-6.8pre.
|
|
|
|
Remove the `[' character from the GDB-6.8 default message.
|
|
|
|
|
2015-11-03 21:28:36 +00:00
|
|
|
Index: gdb-7.10.50.20151027/gdb/testsuite/gdb.base/fork-detach.c
|
2008-03-03 16:13:47 +00:00
|
|
|
===================================================================
|
|
|
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
2015-11-03 21:28:36 +00:00
|
|
|
+++ gdb-7.10.50.20151027/gdb/testsuite/gdb.base/fork-detach.c 2015-10-27 22:38:46.693459569 +0100
|
2007-04-22 20:16:04 +00:00
|
|
|
@@ -0,0 +1,57 @@
|
|
|
|
+/* This testcase is part of GDB, the GNU debugger.
|
|
|
|
+
|
|
|
|
+ Copyright 2007 Free Software Foundation, Inc.
|
|
|
|
+
|
|
|
|
+ This program is free software; you can redistribute it and/or modify
|
|
|
|
+ it under the terms of the GNU General Public License as published by
|
|
|
|
+ the Free Software Foundation; either version 2 of the License, or
|
|
|
|
+ (at your option) any later version.
|
|
|
|
+
|
|
|
|
+ This program is distributed in the hope that it will be useful,
|
|
|
|
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
+ GNU General Public License for more details.
|
|
|
|
+
|
|
|
|
+ You should have received a copy of the GNU General Public License
|
|
|
|
+ along with this program; if not, write to the Free Software
|
|
|
|
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
+
|
|
|
|
+ Please email any bugs, comments, and/or additions to this file to:
|
|
|
|
+ bug-gdb@prep.ai.mit.edu */
|
|
|
|
+
|
|
|
|
+#include <sys/types.h>
|
|
|
|
+#include <sys/wait.h>
|
|
|
|
+#include <unistd.h>
|
|
|
|
+#include <assert.h>
|
|
|
|
+#include <stdlib.h>
|
|
|
|
+
|
|
|
|
+static void func (void)
|
|
|
|
+{
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+int main (void)
|
|
|
|
+{
|
|
|
|
+ pid_t child;
|
|
|
|
+
|
|
|
|
+ child = fork ();
|
|
|
|
+ switch (child)
|
|
|
|
+ {
|
|
|
|
+ case -1:
|
|
|
|
+ abort ();
|
|
|
|
+ case 0:
|
|
|
|
+ func ();
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ {
|
|
|
|
+/* We do not test the switching to the other fork by GDB `fork 1'. */
|
|
|
|
+#if 0
|
|
|
|
+ pid_t got;
|
|
|
|
+
|
|
|
|
+ got = waitpid (child, NULL, 0);
|
|
|
|
+ assert (got == child);
|
|
|
|
+#endif
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return 0;
|
|
|
|
+}
|
2015-11-03 21:28:36 +00:00
|
|
|
Index: gdb-7.10.50.20151027/gdb/testsuite/gdb.base/fork-detach.exp
|
2008-03-03 16:13:47 +00:00
|
|
|
===================================================================
|
|
|
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
2015-11-03 21:28:36 +00:00
|
|
|
+++ gdb-7.10.50.20151027/gdb/testsuite/gdb.base/fork-detach.exp 2015-10-27 22:38:46.693459569 +0100
|
2010-07-21 21:30:20 +00:00
|
|
|
@@ -0,0 +1,36 @@
|
2007-04-22 20:16:04 +00:00
|
|
|
+# Copyright 2007 Free Software Foundation, Inc.
|
|
|
|
+
|
|
|
|
+# This program is free software; you can redistribute it and/or modify
|
|
|
|
+# it under the terms of the GNU General Public License as published by
|
|
|
|
+# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
+# (at your option) any later version.
|
|
|
|
+#
|
|
|
|
+# This program is distributed in the hope that it will be useful,
|
|
|
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
+# GNU General Public License for more details.
|
|
|
|
+#
|
|
|
|
+# You should have received a copy of the GNU General Public License
|
|
|
|
+# along with this program; if not, write to the Free Software
|
2008-03-03 16:13:47 +00:00
|
|
|
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
2007-04-22 20:16:04 +00:00
|
|
|
+
|
|
|
|
+set testfile fork-detach
|
|
|
|
+set srcfile ${testfile}.c
|
|
|
|
+set binfile ${objdir}/${subdir}/${testfile}
|
|
|
|
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
|
|
|
+ untested "Couldn't compile test program"
|
|
|
|
+ return -1
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+# Get things started.
|
|
|
|
+
|
|
|
|
+gdb_exit
|
|
|
|
+gdb_start
|
|
|
|
+gdb_reinitialize_dir $srcdir/$subdir
|
|
|
|
+gdb_load ${binfile}
|
|
|
|
+
|
|
|
|
+gdb_run_cmd
|
|
|
|
+# `Starting program: .*' prefix is available since gdb-6.7.
|
|
|
|
+gdb_test "" \
|
2011-03-20 20:44:20 +00:00
|
|
|
+ "Detaching after fork from child process.*\\\[Inferior .* exited normally\\\]" \
|
2007-04-22 20:16:04 +00:00
|
|
|
+ "Info message caught"
|
2015-11-03 21:28:36 +00:00
|
|
|
Index: gdb-7.10.50.20151027/gdb/infrun.c
|
2015-01-08 20:53:17 +00:00
|
|
|
===================================================================
|
2015-11-03 21:28:36 +00:00
|
|
|
--- gdb-7.10.50.20151027.orig/gdb/infrun.c 2015-10-27 22:38:34.333386939 +0100
|
|
|
|
+++ gdb-7.10.50.20151027/gdb/infrun.c 2015-10-27 22:38:46.695459581 +0100
|
|
|
|
@@ -477,7 +477,7 @@ holding the child stopped. Try \"set de
|
2015-01-08 20:53:17 +00:00
|
|
|
remove_breakpoints_pid (ptid_get_pid (inferior_ptid));
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (info_verbose || debug_infrun)
|
|
|
|
+ if (1 /* Fedora Bug 235197 */ || info_verbose || debug_infrun)
|
|
|
|
{
|
2015-05-31 18:47:21 +00:00
|
|
|
/* Ensure that we have a process ptid. */
|
|
|
|
ptid_t process_ptid = pid_to_ptid (ptid_get_pid (child_ptid));
|
2015-11-03 21:28:36 +00:00
|
|
|
Index: gdb-7.10.50.20151027/gdb/testsuite/gdb.base/catch-syscall.exp
|
|
|
|
===================================================================
|
|
|
|
--- gdb-7.10.50.20151027.orig/gdb/testsuite/gdb.base/catch-syscall.exp 2015-10-27 22:43:47.015224320 +0100
|
|
|
|
+++ gdb-7.10.50.20151027/gdb/testsuite/gdb.base/catch-syscall.exp 2015-10-27 22:44:29.327472955 +0100
|
|
|
|
@@ -165,7 +165,7 @@ proc check_for_program_end {} {
|
|
|
|
# Deleting the catchpoints
|
|
|
|
delete_breakpoints
|
|
|
|
|
|
|
|
- gdb_continue_to_end
|
|
|
|
+ gdb_continue_to_end "" continue 1
|
|
|
|
}
|
|
|
|
|
|
|
|
proc test_catch_syscall_without_args {} {
|
|
|
|
@@ -236,7 +236,7 @@ proc test_catch_syscall_with_wrong_args
|
|
|
|
# If it doesn't, everything is right (since we don't have
|
|
|
|
# a syscall named "mlock" in it). Otherwise, this is a failure.
|
|
|
|
set thistest "catch syscall with unused syscall ($syscall_name)"
|
|
|
|
- gdb_continue_to_end $thistest
|
|
|
|
+ gdb_continue_to_end $thistest continue 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|