Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [commit] Follow forks on HP-UX 11.xx
       [not found] <200507201325.j6KDPZvi030460@elgar.sibelius.xs4all.nl>
@ 2005-07-20 13:35 ` Daniel Jacobowitz
  2005-07-20 16:29   ` Mark Kettenis
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2005-07-20 13:35 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

On Wed, Jul 20, 2005 at 03:25:35PM +0200, Mark Kettenis wrote:
> This patch adds back the feature that was lost when I revised the
> HP-UX native code.  There are still a few rough edges, but it works
> well enough to be useful.  So I committed this.  I'll try to polish up
> the testsuite and fix the bugs that uncovers.

Cool.  Two comments:

> +  if (follow_child)
> +    {
> +      inferior_ptid = ptid_build (fpid, flwpid, 0);
> +      detach_breakpoints (pid);
> +
> +      target_terminal_ours ();
> +      fprintf_unfiltered (gdb_stdlog, _("\
> +Attaching after fork to child process %ld.\n"), (long)fpid);
> +    }
> +  else
> +    {
> +      inferior_ptid = ptid_build (pid, lwpid, 0);
> +      detach_breakpoints (fpid);
> +
> +      target_terminal_ours ();
> +      fprintf_unfiltered (gdb_stdlog, _("\
> +Detaching after fork from child process %ld.\n"), (long)fpid);
> +    }

For GNU/Linux I recently moved these printouts to debug only.  No one
really seems to want to see them unless they already have a catchpoint.

And, the testcases for following vfork all rely on following exec.  I
haven't enabled them, or that feature, because the current user
interface for following exec is so awful - it silently changes which
binary you're debugging, messes up configured breakpoints, etc etc.

I don't recall if you have GNU/Linux systems to test on.  If not, let
me know if you have testsuite changes you want to check with the
GNU/Linux implementation of fork following.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [commit] Follow forks on HP-UX 11.xx
  2005-07-20 13:35 ` [commit] Follow forks on HP-UX 11.xx Daniel Jacobowitz
@ 2005-07-20 16:29   ` Mark Kettenis
  2005-07-20 16:35     ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2005-07-20 16:29 UTC (permalink / raw)
  To: drow; +Cc: gdb-patches

   Date: Wed, 20 Jul 2005 09:34:57 -0400
   From: Daniel Jacobowitz <drow@false.org>

   On Wed, Jul 20, 2005 at 03:25:35PM +0200, Mark Kettenis wrote:
   > This patch adds back the feature that was lost when I revised the
   > HP-UX native code.  There are still a few rough edges, but it works
   > well enough to be useful.  So I committed this.  I'll try to polish up
   > the testsuite and fix the bugs that uncovers.

   Cool.  Two comments:

   > +  if (follow_child)
   > +    {
   > +      inferior_ptid = ptid_build (fpid, flwpid, 0);
   > +      detach_breakpoints (pid);
   > +
   > +      target_terminal_ours ();
   > +      fprintf_unfiltered (gdb_stdlog, _("\
   > +Attaching after fork to child process %ld.\n"), (long)fpid);
   > +    }
   > +  else
   > +    {
   > +      inferior_ptid = ptid_build (pid, lwpid, 0);
   > +      detach_breakpoints (fpid);
   > +
   > +      target_terminal_ours ();
   > +      fprintf_unfiltered (gdb_stdlog, _("\
   > +Detaching after fork from child process %ld.\n"), (long)fpid);
   > +    }

   For GNU/Linux I recently moved these printouts to debug only.  No one
   really seems to want to see them unless they already have a catchpoint.

Hmm yes, spamming the output while following the output doesn't really
make sense.  On the other hand, I think I'd like to see some
indication that GDB switched to following the child.  But we should
make sure that all platforms that support this print the same message.
We should really move the printing of those messages into platform
independent code.

   And, the testcases for following vfork all rely on following exec.  I
   haven't enabled them, or that feature, because the current user
   interface for following exec is so awful - it silently changes which
   binary you're debugging, messes up configured breakpoints, etc etc.

Hmm yes, I noticed that following execs is still disabled.  And yes
the code is a mess.  Any objection against removing it completely and
start afresh.

   I don't recall if you have GNU/Linux systems to test on.  If not, let
   me know if you have testsuite changes you want to check with the
   GNU/Linux implementation of fork following.

Trashed the old SuSE on my amd64 box recently, so I'm going to attempt
installing Fedora Core 4 on it.  You know whether that has a recent
enough kernel that has the fork/vfork following support in it?

Anyway, to what extent does following vfork work on Linux?  Does it
work flawlessly, or are there still some issues?

Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [commit] Follow forks on HP-UX 11.xx
  2005-07-20 16:29   ` Mark Kettenis
@ 2005-07-20 16:35     ` Daniel Jacobowitz
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2005-07-20 16:35 UTC (permalink / raw)
  To: gdb-patches

On Wed, Jul 20, 2005 at 06:29:18PM +0200, Mark Kettenis wrote:
> Hmm yes, spamming the output while following the output doesn't really
> make sense.  On the other hand, I think I'd like to see some
> indication that GDB switched to following the child.  But we should
> make sure that all platforms that support this print the same message.
> We should really move the printing of those messages into platform
> independent code.

Yes, we should, and the logic to control them.

>    And, the testcases for following vfork all rely on following exec.  I
>    haven't enabled them, or that feature, because the current user
>    interface for following exec is so awful - it silently changes which
>    binary you're debugging, messes up configured breakpoints, etc etc.
> 
> Hmm yes, I noticed that following execs is still disabled.  And yes
> the code is a mess.  Any objection against removing it completely and
> start afresh.

I'd rather not touch it until we figure out a better interface; it's
mildly useful as an example of where all the hooks would need to go. 
Unless it gets in the way, of course.

>    I don't recall if you have GNU/Linux systems to test on.  If not, let
>    me know if you have testsuite changes you want to check with the
>    GNU/Linux implementation of fork following.
> 
> Trashed the old SuSE on my amd64 box recently, so I'm going to attempt
> installing Fedora Core 4 on it.  You know whether that has a recent
> enough kernel that has the fork/vfork following support in it?

It should, unless RH's patches managed to break it; that's happened in
the past, but I think it won't happen again in 2.6.x.  Should be fine.

> Anyway, to what extent does following vfork work on Linux?  Does it
> work flawlessly, or are there still some issues?

I believe there's a nasty bit if you try to kill both processes while
stopped at a vfork catchpoint, where you'll end up with a zombie.  I
haven't tried to reproduce that in at least a year, though, so it may
be gone now.  Otherwise it works quite just fine.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-07-20 16:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200507201325.j6KDPZvi030460@elgar.sibelius.xs4all.nl>
2005-07-20 13:35 ` [commit] Follow forks on HP-UX 11.xx Daniel Jacobowitz
2005-07-20 16:29   ` Mark Kettenis
2005-07-20 16:35     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox