* [RFA] Use vfork in shell_escape
@ 2002-10-21 18:51 Daniel Jacobowitz
2002-10-22 13:54 ` Michael Snyder
2002-11-05 13:43 ` Daniel Jacobowitz
0 siblings, 2 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2002-10-21 18:51 UTC (permalink / raw)
To: gdb-patches; +Cc: fnasser
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?
--
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);
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Use vfork in shell_escape
2002-10-21 18:51 [RFA] Use vfork in shell_escape Daniel Jacobowitz
@ 2002-10-22 13:54 ` Michael Snyder
2002-10-22 13:56 ` Daniel Jacobowitz
2002-11-05 13:43 ` Daniel Jacobowitz
1 sibling, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2002-10-22 13:54 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches, fnasser
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.
>
> --
> 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);
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Use vfork in shell_escape
2002-10-22 13:54 ` Michael Snyder
@ 2002-10-22 13:56 ` Daniel Jacobowitz
2002-10-22 14:00 ` Michael Snyder
0 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2002-10-22 13:56 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches, fnasser
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Use vfork in shell_escape
2002-10-22 13:56 ` Daniel Jacobowitz
@ 2002-10-22 14:00 ` Michael Snyder
2002-10-22 14:43 ` Andrew Cagney
0 siblings, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2002-10-22 14:00 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches, fnasser
Daniel Jacobowitz wrote:
>
> 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?
For all I know, that's OK -- but I don't know.
I'll step back now, and wait for someone who does.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Use vfork in shell_escape
2002-10-22 14:00 ` Michael Snyder
@ 2002-10-22 14:43 ` Andrew Cagney
2002-10-22 14:59 ` Elena Zannoni
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2002-10-22 14:43 UTC (permalink / raw)
To: Michael Snyder, fnasser; +Cc: Daniel Jacobowitz, gdb-patches
> Daniel Jacobowitz wrote:
>
>>
>> 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?
>
>
> For all I know, that's OK -- but I don't know.
> I'll step back now, and wait for someone who does.
Yep, from the ARI:
HAVE VFORK #ifdef HAVE_VFORK is redundant. Include "gdb_vfork.h" and
call vfork() unconditionally.
Fernando - CLI?
Andrew
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Use vfork in shell_escape
2002-10-22 14:43 ` Andrew Cagney
@ 2002-10-22 14:59 ` Elena Zannoni
0 siblings, 0 replies; 8+ messages in thread
From: Elena Zannoni @ 2002-10-22 14:59 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Michael Snyder, fnasser, Daniel Jacobowitz, gdb-patches
Andrew Cagney writes:
> > Daniel Jacobowitz wrote:
> >
> >>
> >> 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?
> >
> >
> > For all I know, that's OK -- but I don't know.
> > I'll step back now, and wait for someone who does.
>
> Yep, from the ARI:
>
> HAVE VFORK #ifdef HAVE_VFORK is redundant. Include "gdb_vfork.h" and
> call vfork() unconditionally.
>
What about hpux? [go look....]
Ah, right, we "fixed" hpux by enforcing -Dvfork=fork
Elena
> Fernando - CLI?
>
> Andrew
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Use vfork in shell_escape
2002-10-21 18:51 [RFA] Use vfork in shell_escape Daniel Jacobowitz
2002-10-22 13:54 ` Michael Snyder
@ 2002-11-05 13:43 ` Daniel Jacobowitz
2003-06-21 18:39 ` Daniel Jacobowitz
1 sibling, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2002-11-05 13:43 UTC (permalink / raw)
To: gdb-patches, fnasser
On Mon, Oct 21, 2002 at 09:52:05PM -0400, 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?
Updated as suggested, to use gdb_vfork.h. Fernando, is this OK?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2002-11-05 Daniel Jacobowitz <drow@mvista.com>
* Makefile.in (cli-cmds.o): Add $(gdb_vfork_h).
* cli/cli-cmds.c: Include "gdb_vfork.h".
(shell_escape): Use vfork.
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.274
diff -u -p -r1.274 Makefile.in
--- Makefile.in 2 Nov 2002 15:13:34 -0000 1.274
+++ Makefile.in 5 Nov 2002 21:40:52 -0000
@@ -2311,7 +2311,7 @@ cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(d
$(gdb_wait_h) $(gdb_regex_h) $(gdb_string_h) $(filenames_h) \
$(ui_out_h) $(top_h) $(cli_decode_h) $(cli_script_h) \
$(cli_setshow_h) $(cli_cmds_h) $(source_h) $(linespec_h) \
- $(expression_h) $(language_h) $(objfiles_h)
+ $(expression_h) $(language_h) $(objfiles_h) $(gdb_vfork_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
$(gdb_regex_h) $(gdb_string_h) $(ui_out_h) $(cli_cmds_h) \
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 5 Nov 2002 21:40:53 -0000
@@ -25,6 +25,7 @@
#include "gdb_wait.h" /* For shell escape implementation */
#include "gdb_regex.h" /* Used by apropos_command */
#include "gdb_string.h"
+#include "gdb_vfork.h"
#include "linespec.h"
#include "expression.h"
#include "language.h"
@@ -517,7 +518,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);
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Use vfork in shell_escape
2002-11-05 13:43 ` Daniel Jacobowitz
@ 2003-06-21 18:39 ` Daniel Jacobowitz
0 siblings, 0 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2003-06-21 18:39 UTC (permalink / raw)
To: gdb-patches
On Tue, Nov 05, 2002 at 04:44:14PM -0500, Daniel Jacobowitz wrote:
> On Mon, Oct 21, 2002 at 09:52:05PM -0400, 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?
>
> Updated as suggested, to use gdb_vfork.h. Fernando, is this OK?
I've checked in this old patch.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2003-06-21 Daniel Jacobowitz <drow@mvista.com>
* Makefile.in (cli-cmds.o): Depend on $(gdb_vfork_h)
* cli/cli-cmds.c: Include "gdb_vfork.h".
(shell_escape): Use vfork.
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.408
diff -u -p -r1.408 Makefile.in
--- Makefile.in 19 Jun 2003 22:52:03 -0000 1.408
+++ Makefile.in 21 Jun 2003 18:36:46 -0000
@@ -2416,7 +2416,7 @@ cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(d
$(gdb_wait_h) $(gdb_regex_h) $(gdb_string_h) $(filenames_h) \
$(ui_out_h) $(top_h) $(cli_decode_h) $(cli_script_h) \
$(cli_setshow_h) $(cli_cmds_h) $(source_h) $(linespec_h) \
- $(expression_h) $(language_h) $(objfiles_h)
+ $(expression_h) $(language_h) $(objfiles_h) $(gdb_vfork_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
$(gdb_regex_h) $(gdb_string_h) $(ui_out_h) $(cli_cmds_h) \
Index: cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.31
diff -u -p -r1.31 cli-cmds.c
--- cli/cli-cmds.c 8 Jun 2003 18:27:14 -0000 1.31
+++ cli/cli-cmds.c 21 Jun 2003 18:36:46 -0000
@@ -26,6 +26,7 @@
#include "gdb_wait.h" /* For shell escape implementation */
#include "gdb_regex.h" /* Used by apropos_command */
#include "gdb_string.h"
+#include "gdb_vfork.h"
#include "linespec.h"
#include "expression.h"
#include "frame.h"
@@ -509,7 +510,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);
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2003-06-21 18:39 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-21 18:51 [RFA] Use vfork in shell_escape Daniel Jacobowitz
2002-10-22 13:54 ` Michael Snyder
2002-10-22 13:56 ` Daniel Jacobowitz
2002-10-22 14:00 ` Michael Snyder
2002-10-22 14:43 ` Andrew Cagney
2002-10-22 14:59 ` Elena Zannoni
2002-11-05 13:43 ` Daniel Jacobowitz
2003-06-21 18:39 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox