This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch] Zap more #ifdef HAVE_VFORK
- To: Kevin Buettner <kevinb at cygnus dot com>
- Subject: Re: [patch] Zap more #ifdef HAVE_VFORK
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Fri, 06 Apr 2001 14:47:24 -0400
- Cc: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- References: <3ABF722C.EDDEF9BC@cygnus.com> <1010327002437.ZM2540@ocotillo.lan>
Kevin Buettner wrote:
>
> On Mar 26, 11:45am, Andrew Cagney wrote:
>
> > Missed this when re-fixing the autoconfed vfork() call.
> [...]
> > /* Clone the debugger. */
> > - #ifdef HAVE_VFORK
> > if (debug_fork)
> > debugger_pid = fork ();
> > else
> > debugger_pid = vfork ();
> > - #else
> > - debugger_pid = fork ();
> > - #endif
>
> This didn't make any sense to me at first. It did when I went back
> and (re)read
I know it doesn't make sense :-) It is how autoconf does it though :-/
> If we're going to use the AC_FUNC_VFORK mechanisms, might I suggest
> that we do one of the following?
>
> 1) Document the fact that the autoconf cleverness *might* actually
> have defined vfork to be fork at each use vfork.
Ok by me. In general adding comments explaining how bits of code work
are probably obvious fixes.
> 2) Create a gdb_fork() which does the appropriate thing *and*
> documents the autoconf cleverness in the guts of gdb_fork().
I don't think this one would work very well. From memory you're not
ment to return from a vfork().
Andrew