Re: gdb and dlopen

Daniel Jacobowitz
2001-10-17T14:34:00Z

On Wed, Oct 17, 2001 at 11:26:08PM +0200, Mark Kettenis wrote:
> 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.

Well, that's somewhat unfortunate. I guess there may not be anything
we can do in that case.

> 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.

Well, I'm not sure if there are any systems using thread_db that allow
this model, but it's reasonable in general to share heap but not stack.
I'll certainly bow to your judgement here, though. Being able to read
from only the primary PID would be convenient - although I'm not sure
what to do in the case where that first thread exits.

--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer