From: Mark Kettenis <kettenis@wins.uva.nl>
To: drow@mvista.com
Cc: ac131313@cygnus.com, kimball@sgrail.com, gdb@sources.redhat.com
Subject: Re: gdb and dlopen
Date: Wed, 17 Oct 2001 14:26:00 -0000 [thread overview]
Message-ID: <200110172126.f9HLQ8700257@delius.kettenis.local> (raw)
In-Reply-To: <20011017140950.A10927@nevyn.them.org>
Date: Wed, 17 Oct 2001 14:09:50 -0400
From: Daniel Jacobowitz <drow@mvista.com>
(Shouldn't there be a way for us to tell when a thread dies without
receiving the TD_DEATH event anyway? We -are- attached to all threads,
and LinuxThreads threads are all separate processes...)
Ultimately waitpid() will report that the process has exited.
Unfortunately there seems to be a window where we cannot access that
process's memory with ptrace, while waitpid() hasn't reported that
exit yet.
> If we declare glibc 2.1.3 broken, and force people to upgrade to glibc
> 2.2.x, we could assume that a thread stays alive between TD_CREATE and
> TD_DEATH, and speed up thread_db_thread_alive considerably.
>
> Something similar can be done for lwp_from_threads since assigning a
> thread to a particular LWP can be reported too (never happens on Linux
> since LinuxThreads uses a 1:1 mapping).
>
> Note that if we assume that all threads see the same VM, and that the
> initial LWP stays alive during the execution of the program, we could
> simply use the process ID of the initial LWP for all memory transfers,
> which would remove the need for those checks completely.
I'm not entirely comfortable with that assumption, especially since
this is in thread-db rather than the LinuxThreads specific code. But
perhaps we could introduce a target method saying what PID to use for
reads? Then we could make Linux (I'm perfectly comfortable with not
supporting thread debugging on 2.1.3...) simply return the PID without
any expensive checks.
I think the assumption that all threads/LWPs share the same VM is a
fair assumption for thread-db. GDB assumes this model in several
places, and you'd probably wouldn't call processes not sharing their
VM threads at all.
As an aside, it appears that Solaris doesn't even allow you to read
memory from a particular LWP at all.
Mark
next prev parent reply other threads:[~2001-10-17 14:26 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <y3radyrjqf8.wl@paladin.sgrail.com>
2001-10-16 13:15 ` Daniel Jacobowitz
2001-10-16 18:23 ` Kimball Thurston
[not found] ` <20011016213252.A8694@nevyn.them.org>
2001-10-16 19:03 ` Daniel Jacobowitz
2001-10-16 20:04 ` Kimball Thurston
2001-10-16 20:17 ` Andrew Cagney
2001-10-16 22:08 ` Daniel Jacobowitz
2001-10-16 22:19 ` Daniel Jacobowitz
[not found] ` <y3rzo6qx1ej.wl@paladin.sgrail.com>
2001-10-16 22:52 ` Kimball Thurston
2001-10-17 8:07 ` Mark Kettenis
2001-10-17 8:29 ` H . J . Lu
2001-10-17 11:09 ` Daniel Jacobowitz
2001-10-17 14:26 ` Mark Kettenis [this message]
2001-10-17 14:34 ` Daniel Jacobowitz
2001-10-17 8:54 ` Andrew Cagney
2001-10-17 15:08 ` Kevin Buettner
2001-10-17 15:57 ` Andrew Cagney
2001-10-17 17:05 ` Daniel Jacobowitz
2001-10-17 23:14 ` Andrew Cagney
2001-10-17 8:42 ` Andrew Cagney
2001-10-17 11:15 ` Daniel Jacobowitz
2001-10-17 12:09 ` Kimball Thurston
2001-10-17 12:58 ` Kevin Buettner
2001-11-08 0:22 ` Daniel Jacobowitz
2001-11-08 8:17 ` Kevin Buettner
2001-11-08 9:44 ` Daniel Jacobowitz
2001-11-08 10:49 ` Kevin Buettner
2001-11-08 11:14 ` Daniel Jacobowitz
2001-11-08 16:17 ` Andrew Cagney
2001-10-16 22:25 ` Kimball Thurston
2001-10-16 15:05 ` H . J . Lu
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=200110172126.f9HLQ8700257@delius.kettenis.local \
--to=kettenis@wins.uva.nl \
--cc=ac131313@cygnus.com \
--cc=drow@mvista.com \
--cc=gdb@sources.redhat.com \
--cc=kimball@sgrail.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