Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@gnu.org>
To: drow@false.org
Cc: eliz@gnu.org, jjohnstn@redhat.com, gdb-patches@sources.redhat.com
Subject: Re: [RFA]: Modified Watchthreads Patch
Date: Sat, 11 Dec 2004 19:06:00 -0000	[thread overview]
Message-ID: <200412111849.iBBInZRn007863@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <20041211163652.GB13865@nevyn.them.org> (message from Daniel Jacobowitz on Sat, 11 Dec 2004 11:36:52 -0500)

   Date: Sat, 11 Dec 2004 11:36:52 -0500
   From: Daniel Jacobowitz <drow@false.org>

   > Adding hacks around hacks, like we've been doing to support threads on
   > Linux for quite some time now is defenitely not a good idea.

   Mark, would you please stop saying this?  I don't believe it to be true
   any more.  If you think it's still accurate, please point me at
   specific hacks around hacks, and let's see if we can get rid of them
   now.

Sorry Daniel, I know you've done some really good work with regard to
threads in the kernel.  I guess I'm still somewhat frustrated about
the situation back when I wrote the initial Linux LWP layer.  Back
then the attitude of the kernel developers was basically: "We won't
complicate the kernel with support for debuggers, solve everything
from userland!".

That said, there is just too much code in linux-nat.c.  If you compare
the code necessary to implement to_wait and to_resume that's there
with the amount of code in inf-ttrace.c, you see what I mean.  Most of
the code is present because we need to stop each thread individually
by sending it a SIGSTOP.  Things become so much simpler if the kernel
would provide an interface to stop them all in one go that doesn't
interfere with signal delivery...

   I admit there are some peculiarities related to stopping all threads.
   But most of them are related to very real situations that we want to be
   able to debug: two threads receiving a signal at the same time, hitting
   different breakpoints at the same time, et cetera.  Life with threads
   is just more complicated.  Some platforms do the complicated bits in
   the kernel, and Linux chose to expose an LWP-oriented interface rather
   than a whole-process oriented interface so we have to do the
   complicated bits in userspace.  That is not going to change, because
   the Linux design philosophy for threading is that they are just a
   special kind of process; Linux has no concept of "the whole process"
   and will not be adding one.  This has been discussed from time to time
   on the linux-kernel list.  [There is some correlation to the POSIX
   threading concept of a process, for the purpose of POSIX-compliant
   signal delivery, but that's the extent of it.]

I still think this is wrong.  The very fact that these proceses share
a virtual memory space means that they're grouped together.  The
kernel shouldn't deny that.  But even if folks don't want to support
freezing that memory space atomically (at least to the observer), we
really need a way to stop each process individually that doesn't
interfere with signal delivery.  I sincerely believe that we'll keep
seeing thread-related problems if it isn't possible to stop threads
while keeping all signals pending.

   And I'm busily (at work) improving platform support for NPTL; one of my
   goals is to someday rip all the LinuxThreads support code out of GDB. 
   But it's going to be a long time before that's a viable option - at
   least a couple of years from now.  That's no more friendly than
   dropping support for all but the newest kernel.  And we'll need some
   of that code to provide quality support for debugging multiple
   processes simultaneously, or to support debugging applications which
   use clone() directly.

Your work is very much appreciated.

Mark


  parent reply	other threads:[~2004-12-11 18:50 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-10  4:24 Jeff Johnston
2004-12-10 13:31 ` Eli Zaretskii
2004-12-10 14:21   ` Daniel Jacobowitz
2004-12-10 18:01     ` Jeff Johnston
2004-12-24 11:05       ` Michael Snyder
2005-01-07  0:23         ` jjohnstn
2004-12-10 23:01     ` Eli Zaretskii
2004-12-10 23:31       ` Daniel Jacobowitz
2004-12-10 19:10   ` Jeff Johnston
2004-12-10 22:51     ` Eli Zaretskii
2004-12-23 22:32   ` Michael Snyder
2004-12-24 14:46     ` Eli Zaretskii
2004-12-10 20:03 ` Daniel Jacobowitz
2004-12-10 20:30   ` Jeff Johnston
2004-12-10 20:47     ` Daniel Jacobowitz
2004-12-10 22:18       ` Jeff Johnston
2004-12-10 23:57         ` Jeff Johnston
2004-12-11  0:31           ` Daniel Jacobowitz
2004-12-11  1:28             ` Jeff Johnston
2004-12-11 14:34           ` Eli Zaretskii
2004-12-11 16:56             ` Daniel Jacobowitz
2004-12-11 18:01               ` Eli Zaretskii
2004-12-11 18:06                 ` Daniel Jacobowitz
2004-12-11 19:08                   ` Eli Zaretskii
2004-12-11 19:30                     ` Daniel Jacobowitz
2004-12-12  5:22                       ` Eli Zaretskii
2004-12-11 21:54                   ` Mark Kettenis
2004-12-11 14:53           ` Mark Kettenis
2004-12-11 16:52             ` Eli Zaretskii
2004-12-11  2:04       ` Daniel Jacobowitz
2004-12-11 16:11         ` Mark Kettenis
2004-12-10 23:06   ` Eli Zaretskii
2004-12-10 23:10     ` Daniel Jacobowitz
2004-12-10 23:37       ` Eli Zaretskii
2004-12-10 23:52         ` Daniel Jacobowitz
2004-12-11 11:32           ` Eli Zaretskii
2004-12-11 14:49             ` Mark Kettenis
2004-12-11 16:48               ` Daniel Jacobowitz
2004-12-11 17:33                 ` Eli Zaretskii
2004-12-11 17:53                   ` Daniel Jacobowitz
2004-12-11 18:07                     ` Eli Zaretskii
2004-12-11 18:50                       ` Daniel Jacobowitz
2004-12-11 19:06                 ` Mark Kettenis [this message]
2004-12-11 19:07                   ` Daniel Jacobowitz
2004-12-11 16:49               ` Eli Zaretskii
2004-12-11 16:37             ` Daniel Jacobowitz
2004-12-11 17:30               ` Eli Zaretskii
2004-12-11 17:38                 ` Daniel Jacobowitz
2004-12-11 18:02                   ` Eli Zaretskii
2004-12-11 18:10                     ` Daniel Jacobowitz
2005-01-13 19:22                   ` Jeff Johnston
2005-02-11  1:57                     ` Daniel Jacobowitz
2005-02-11 18:18                       ` Eli Zaretskii
2005-02-11 18:31                         ` Daniel Jacobowitz
2005-02-12 21:50                           ` Eli Zaretskii
2004-12-11 19:35 Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200412111849.iBBInZRn007863@elgar.sibelius.xs4all.nl \
    --to=kettenis@gnu.org \
    --cc=drow@false.org \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jjohnstn@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox