Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sourceware.org
Subject: Re: RFC: Unify the GNU/Linux native targets
Date: Sat, 11 Mar 2006 01:44:00 -0000	[thread overview]
Message-ID: <4411DC21.2040305@redhat.com> (raw)
In-Reply-To: <20060227192807.GA25537@nevyn.them.org>

Daniel Jacobowitz wrote:
> A wart I've been meaning to come back to for ages; I have some fixes for
> thread debugging in static binaries that would have been quite ugly
> without this, so I took a day to do it.
> 
> There are two target vectors in the current incarnation of linux-nat.c.  The
> one returned by linux_target () and inherited by target-specific files is
> used for non-threaded applications; it handles basic operations including
> target-specific extensions to them.  The one built in linux_nat_ops
> handles clone and can be used with libthread_db, and delegates to the
> single-threaded variant for basic tasks.
> 
> This is a bit silly :-)  We still need the separation between single and
> multi-threaded vectors for the moment, because targets want to override
> the single-threaded primitives rather than the complex multi-threaded
> layer.  However, that's all we need the single-threaded vector for.  We
> don't ever need to _use_ it.
> 
> This patch kills most of the single-threaded vector and arranges to
> use the multi-threaded version in all cases.  Some duplicated code
> goes away, and it is suddenly much easier to switch back and forth
> between "threaded" and "non-threaded" debugging.
> 
> One oddity: the Linux native target remains at process_stratum even
> though it supports threads.  I think this is right; the thread_stratum
> gets used for linux-thread-db.c support which delegates to the process
> stratum.  If we had arbitrary stacking instead of strata I might
> stack the linux multithreaded bits above the linux single-threaded
> bits, but I think this is more natural.
> 
> Tested on x86_64-pc-linux-gnu.  Any comments?  Seems like progress?
> 
> Depends on my previous linux-fork.c patch, but only trivially.
> 

Daniel, this seems fairly sane, at least with respect to forks.
It does touch code that is also touched by my recent patch,
though, so merge carefully.   ;-)

This, for instance,

+
+  /* First cut -- let's crudely do everything inline.  */
+  if (forks_exist_p ())
+    {
+      linux_fork_killall ();
+      pop_target ();
+      generic_mourn_inferior ();
+      return;
+    }
+
    /* Kill all LWP's ...  */

would want to be modified so as to read something like:

	linux_fork_killall ();
	target_mourn_inferior ();
	return;

(I think...)


  parent reply	other threads:[~2006-03-10 20:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-27 19:44 Daniel Jacobowitz
2006-02-27 20:40 ` Mark Kettenis
2006-02-27 20:51   ` Daniel Jacobowitz
2006-03-11  1:44 ` Michael Snyder [this message]
2006-03-25  0:06   ` Daniel Jacobowitz

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=4411DC21.2040305@redhat.com \
    --to=msnyder@redhat.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    /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