From: Daniel Jacobowitz <drow@false.org>
To: Vladimir Prus <vladimir@codesourcery.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [linux] fix stepping over fork in follow-child mode.
Date: Wed, 19 Mar 2008 12:49:00 -0000 [thread overview]
Message-ID: <20080319124933.GA12197@caradoc.them.org> (raw)
In-Reply-To: <frqh16$7rk$1@ger.gmane.org>
On Wed, Mar 19, 2008 at 10:57:27AM +0300, Vladimir Prus wrote:
> 1. Your patch seem to remove thread_db_resume, including this
> bit of code in it:
>
> if (GET_PID (ptid) == -1)
> inferior_ptid = lwp_from_thread (inferior_ptid);
> else if (is_thread (ptid))
> ptid = lwp_from_thread (ptid);
>
> What was the code, and in particular the last line, trying to do,
> and why we don't actually have to do this?
This converts "ptid known by thread_db and the rest of gdb" to "ptid
known by linux-nat". A ptid is (PID, LWP, TID). linux-thread-db.c's
ptids used to look like (PID, 0, TID) and the above call converted it
to (PID, LWP, 0). A few years ago, I changed linux-thread-db to use
(PID, LWP, TID) - in other words to assume that each TID was
permanently assigned to a single LWP. That simplified things a lot.
This is not true on some platforms. On Solaris, for instance, you may
end up with M light-weight processes, and N threads, with N > M. Each
process grabs a thread to execute as its previous thread goes to
sleep. So the LWP can change.
> 2. It seems that some other modules use tid. In particular,
> aix-thread.c makes use of the ptid_get_tid call. What to do about that?
We're fixing a Linux-specific problem, caused by not knowing the tid
right away - so there isn't a single TID for the entire life of the
application. If other platforms have the same problem, they can fix
it locally. I think having a thread at all times is something that
we're going to have to do in platform-specific code :-(
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2008-03-19 12:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-18 20:47 Pedro Alves
2008-03-18 23:48 ` Daniel Jacobowitz
[not found] ` <frqh16$7rk$1@ger.gmane.org>
2008-03-19 12:49 ` Daniel Jacobowitz [this message]
2008-03-19 16:03 ` Daniel Jacobowitz
2008-03-19 19:22 ` Joel Brobecker
2008-03-19 19:27 ` Daniel Jacobowitz
2008-03-19 22:19 ` Nick Roberts
2008-03-19 22:47 ` Daniel Jacobowitz
2008-03-21 15:45 ` 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=20080319124933.GA12197@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
--cc=vladimir@codesourcery.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