This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Use vfork in shell_escape
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Michael Snyder <msnyder at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com, fnasser at redhat dot com
- Date: Tue, 22 Oct 2002 16:56:54 -0400
- Subject: Re: [RFA] Use vfork in shell_escape
- References: <20021022015205.GA22323@nevyn.them.org> <3DB5BAE9.2A01D78F@redhat.com>
On Tue, Oct 22, 2002 at 01:54:01PM -0700, Michael Snyder wrote:
> Daniel Jacobowitz wrote:
> >
> > This patch is pretty obvious. I couldn't figure out why my machine was
> > running out of memory; forking GDB to run an 'ls' during the maint.exp tests
> > can be a bit heavy, since it may have all of glibc's debug info loaded.
> > This patch seems logical to me... OK to commit?
>
> Not as is. There's some auto-confery involved, since many systems
> (some systems?) don't have vfork. Grep for vfork in fork-child.c.
Not as much as there used to be. But you're right, I goofed. OK with
the addition of '#include "gdb_vfork.h"', which is all fork-child.c
uses now?
>
> >
> > --
> > Daniel Jacobowitz
> > MontaVista Software Debian GNU/Linux Developer
> >
> > 2002-10-21 Daniel Jacobowitz <drow@mvista.com>
> >
> > * cli/cli-cmds.c (shell_escape): Use vfork.
> >
> > Index: cli/cli-cmds.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
> > retrieving revision 1.22
> > diff -u -p -r1.22 cli-cmds.c
> > --- cli/cli-cmds.c 22 Sep 2002 22:18:41 -0000 1.22
> > +++ cli/cli-cmds.c 22 Oct 2002 01:47:15 -0000
> > @@ -517,7 +517,7 @@ shell_escape (char *arg, int from_tty)
> > else
> > p++; /* Get past '/' */
> >
> > - if ((pid = fork ()) == 0)
> > + if ((pid = vfork ()) == 0)
> > {
> > if (!arg)
> > execl (user_shell, p, 0);
>
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer