]> git.pld-linux.org Git - packages/gdb.git/blob - gdb-6.6-bz235197-fork-detach-info.patch
- typo
[packages/gdb.git] / gdb-6.6-bz235197-fork-detach-info.patch
1 2008-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
6 Index: gdb-7.2.50.20110320/gdb/linux-nat.c
7 ===================================================================
8 --- gdb-7.2.50.20110320.orig/gdb/linux-nat.c    2011-03-20 16:59:51.000000000 +0100
9 +++ gdb-7.2.50.20110320/gdb/linux-nat.c 2011-03-20 16:59:51.000000000 +0100
10 @@ -716,7 +716,7 @@ holding the child stopped.  Try \"set de
11               remove_breakpoints_pid (GET_PID (inferior_ptid));
12             }
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,
19 Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.c
20 ===================================================================
21 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
22 +++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.c    2011-03-20 16:59:51.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 +}
81 Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.exp
82 ===================================================================
83 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
84 +++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.exp  2011-03-20 17:12:22.000000000 +0100
85 @@ -0,0 +1,36 @@
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 +set testfile fork-detach
103 +set srcfile ${testfile}.c
104 +set binfile ${objdir}/${subdir}/${testfile}
105 +if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
106 +    untested "Couldn't compile test program"
107 +    return -1
108 +}
109 +
110 +# Get things started.
111 +
112 +gdb_exit
113 +gdb_start
114 +gdb_reinitialize_dir $srcdir/$subdir
115 +gdb_load ${binfile}
116 +
117 +gdb_run_cmd
118 +# `Starting program: .*' prefix is available since gdb-6.7.
119 +gdb_test "" \
120 +         "Detaching after fork from child process.*\\\[Inferior .* exited normally\\\]" \
121 +         "Info message caught"
This page took 0.060628 seconds and 3 git commands to generate.