]> git.pld-linux.org Git - packages/gdb.git/blame - gdb-6.6-bz235197-fork-detach-info.patch
- update to gdb-7.0-7.fc12.src.rpm; but leave cactus patches as these seem newer
[packages/gdb.git] / gdb-6.6-bz235197-fork-detach-info.patch
CommitLineData
3a58abaf
AM
12008-03-01 Jan Kratochvil <jan.kratochvil@redhat.com>
2
3 Port to GDB-6.8pre.
4 Remove the `[' character from the GDB-6.8 default message.
5
6Index: gdb-6.7.50.20080227/gdb/linux-nat.c
7===================================================================
8--- gdb-6.7.50.20080227.orig/gdb/linux-nat.c 2008-03-01 10:30:48.000000000 +0100
9+++ gdb-6.7.50.20080227/gdb/linux-nat.c 2008-03-01 10:48:25.000000000 +0100
10@@ -415,7 +415,7 @@ linux_child_follow_fork (struct target_o
11 /* Detach new forked process? */
12 if (detach_fork)
13 {
14- if (info_verbose || debug_linux_nat)
15+ if (1 /* Fedora Bug 235197 */ || info_verbose || debug_linux_nat)
16 {
17 target_terminal_ours ();
18 fprintf_filtered (gdb_stdlog,
19Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.base/fork-detach.c
20===================================================================
21--- /dev/null 1970-01-01 00:00:00.000000000 +0000
22+++ gdb-6.7.50.20080227/gdb/testsuite/gdb.base/fork-detach.c 2008-03-01 10:30:49.000000000 +0100
23@@ -0,0 +1,57 @@
24+/* This testcase is part of GDB, the GNU debugger.
25+
26+ Copyright 2007 Free Software Foundation, Inc.
27+
28+ This program is free software; you can redistribute it and/or modify
29+ it under the terms of the GNU General Public License as published by
30+ the Free Software Foundation; either version 2 of the License, or
31+ (at your option) any later version.
32+
33+ This program is distributed in the hope that it will be useful,
34+ but WITHOUT ANY WARRANTY; without even the implied warranty of
35+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36+ GNU General Public License for more details.
37+
38+ You should have received a copy of the GNU General Public License
39+ along with this program; if not, write to the Free Software
40+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
41+
42+ Please email any bugs, comments, and/or additions to this file to:
43+ bug-gdb@prep.ai.mit.edu */
44+
45+#include <sys/types.h>
46+#include <sys/wait.h>
47+#include <unistd.h>
48+#include <assert.h>
49+#include <stdlib.h>
50+
51+static void func (void)
52+{
53+}
54+
55+int main (void)
56+{
57+ pid_t child;
58+
59+ child = fork ();
60+ switch (child)
61+ {
62+ case -1:
63+ abort ();
64+ case 0:
65+ func ();
66+ break;
67+ default:
68+ {
69+/* We do not test the switching to the other fork by GDB `fork 1'. */
70+#if 0
71+ pid_t got;
72+
73+ got = waitpid (child, NULL, 0);
74+ assert (got == child);
75+#endif
76+ break;
77+ }
78+ }
79+ return 0;
80+}
81Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.base/fork-detach.exp
82===================================================================
83--- /dev/null 1970-01-01 00:00:00.000000000 +0000
84+++ gdb-6.7.50.20080227/gdb/testsuite/gdb.base/fork-detach.exp 2008-03-01 10:49:36.000000000 +0100
85@@ -0,0 +1,43 @@
86+# Copyright 2007 Free Software Foundation, Inc.
87+
88+# This program is free software; you can redistribute it and/or modify
89+# it under the terms of the GNU General Public License as published by
90+# the Free Software Foundation; either version 2 of the License, or
91+# (at your option) any later version.
92+#
93+# This program is distributed in the hope that it will be useful,
94+# but WITHOUT ANY WARRANTY; without even the implied warranty of
95+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96+# GNU General Public License for more details.
97+#
98+# You should have received a copy of the GNU General Public License
99+# along with this program; if not, write to the Free Software
100+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
101+
102+if $tracelevel then {
103+ strace $tracelevel
104+}
105+
106+set prms_id 0
107+set bug_id 0
108+
109+set testfile fork-detach
110+set srcfile ${testfile}.c
111+set binfile ${objdir}/${subdir}/${testfile}
112+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
113+ untested "Couldn't compile test program"
114+ return -1
115+}
116+
117+# Get things started.
118+
119+gdb_exit
120+gdb_start
121+gdb_reinitialize_dir $srcdir/$subdir
122+gdb_load ${binfile}
123+
124+gdb_run_cmd
125+# `Starting program: .*' prefix is available since gdb-6.7.
126+gdb_test "" \
127+ "Detaching after fork from child process.*Program exited normally\\..*" \
128+ "Info message caught"
This page took 0.05028 seconds and 4 git commands to generate.