From: Thomas Schwinge <thomas@codesourcery.com>
To: Yue Lu <hacklu.newborn@gmail.com>, Pedro Alves <palves@redhat.com>
Cc: gdb-patches <gdb-patches@sourceware.org>,
Luis Machado <lgustavo@codesourcery.com>, <bug-hurd@gnu.org>
Subject: Re: [PATCH 1/2] Port gdbserver to GNU/Hurd
Date: Mon, 09 Sep 2013 09:58:00 -0000 [thread overview]
Message-ID: <87bo42b9l7.fsf@kepler.schwinge.homeip.net> (raw)
In-Reply-To: <CAB8fV=ht5n7NzEk7a-3MPdex2EfrH5y98hLgQAneN9HUS-Ek3g@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2443 bytes --]
Hi!
On Sun, 8 Sep 2013 21:35:05 +0800, Yue Lu <hacklu.newborn@gmail.com> wrote:
> On Fri, Sep 6, 2013 at 5:37 AM, Thomas Schwinge <thomas@codesourcery.com> wrote:
> >> (correct me if
> >> I'm wrong here), the Hurd's threads are kernel threads
> >
> > Correct.
> >
> >> so it'd
> >> be better to just make the GDB side use the lwp field too.
> >> It's really a simple and mechanic change. Nothing in GDB core
> >> actually cares which field is used. So in this case, it'd be
In GDB's parlance, a lightweight process (identified by a LWP) is a
thread that always has a corresponding kernel thread, and in contrast a
"generic" thread (identified by a TID) is not required to always have a
corresponding kernel thread, for example, when managed by a run-time
library? Then, yes, conceptually the native Hurd port should be switched
to using LWPs instead of TIDs.
> >> better if you send a preparatory patch
> >
> > Based on the current upstream master branch.
>
> Should I change the gdb use lwp filed instead of tid field? There are
> too many functions use tid. Like
> make_proc(),inf_tid_to_thread(),ptid_build(), and there is a field
> named tid in the structure proc also.
As you have found, there is a lot of TID usage in gnu-nat.c. TIDs are
assigned based on the next_thread_id variable:
/* A variable from which to assign new TIDs. */
static int next_thread_id = 1;
[...]
/* THREADS[I] is a thread we don't know about yet! */
{
ptid_t ptid;
thread = make_proc (inf, threads[i], next_thread_id++);
Five years ago, we've already concluded this is due for some cleanup,
<http://www.gnu.org/software/hurd/open_issues/gdb_thread_ids.html>. But
I don't want to require this cleanup to happen before/in context of the
Google Summer of Code project's code submission discussed here.
> We can define a macro for gdbserver to use another ptid_build function
> to use lwp instead of tid, if this, we only need do a little change.
That seems like a sensible approach to me, for the moment. And then do
the cleanup later on.
> Because of there are a lot of place to improve in my patch, I will
> submit my next patch a little later. Now I have only finished
> removing the spurious blank and the soft link.
That's fine. Such tasks always takes longer than expected. ;-)
Grüße,
Thomas
[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]
next prev parent reply other threads:[~2013-09-09 9:58 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAB8fV=jJ64i91VW52ZmdnEDZhd1ZGTAykDqoFyPJanCP=5beqA@mail.gmail.com>
2013-09-03 8:03 ` [PATCH 2/2] " Yue Lu
2013-09-03 9:38 ` [PATCH 1/2] " Thomas Schwinge
2013-09-03 11:11 ` Pedro Alves
2013-09-03 13:09 ` Thomas Schwinge
2013-09-04 1:47 ` Yue Lu
2013-09-04 1:38 ` Yue Lu
2013-09-05 10:54 ` Yue Lu
2013-09-05 19:29 ` Pedro Alves
2013-09-05 19:39 ` Joel Brobecker
2013-09-05 21:38 ` Thomas Schwinge
2013-09-08 13:35 ` Yue Lu
2013-09-09 9:58 ` Thomas Schwinge [this message]
2013-09-18 12:12 ` Pedro Alves
2013-09-18 13:48 ` Yue Lu
2013-09-18 14:52 ` [Hurd/gnu-nat.c] Use ptid_t.lwpid to store, thread ids instead of ptid_t.tid. (was: Re: [PATCH 1/2] Port gdbserver to GNU/Hurd) Pedro Alves
2013-09-18 14:57 ` [PATCH 1/2] Port gdbserver to GNU/Hurd Pedro Alves
2013-09-22 12:58 ` Yue Lu
2013-09-06 18:53 ` Pedro Alves
2013-09-12 3:05 ` Yue Lu
2013-09-18 12:30 ` Pedro Alves
2013-09-18 12:37 ` Pedro Alves
2013-09-19 7:41 ` Yue Lu
2013-09-19 8:30 ` FAIL: gdb.base/nextoverexit.exp: next over exit (the program exited) (was: [PATCH 1/2] Port gdbserver to GNU/Hurd) Thomas Schwinge
2013-09-19 8:44 ` FAIL: gdb.base/nextoverexit.exp: next over exit (the program exited) Pedro Alves
2013-09-09 10:21 ` [PATCH 1/2] Port gdbserver to GNU/Hurd Yue 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=87bo42b9l7.fsf@kepler.schwinge.homeip.net \
--to=thomas@codesourcery.com \
--cc=bug-hurd@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=hacklu.newborn@gmail.com \
--cc=lgustavo@codesourcery.com \
--cc=palves@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