public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Remove get_thread_id
Date: Tue, 04 Aug 2015 17:30:00 -0000	[thread overview]
Message-ID: <20150804173043.GK4777@adacore.com> (raw)
In-Reply-To: <1438260744-14116-1-git-send-email-yao.qi@linaro.org>

> This patch removes get_thread_id from aarch64-linux-nat.c,
> arm-linux-nat.c and xtensa-linux-nat.c.
> 
> get_thread_id was added in this commit below in 2000,
> 
>   41c49b06c471443d3baf2eaa2463a315f9b5edca
>   https://sourceware.org/ml/gdb-patches/2000-04/msg00398.html
> 
> which predates the ptid_t stuff added into GDB.  Nowadays, lwpid of
> inferior_ptid is only zero when the inferior is created (in
> fork-child.c:fork_inferior) and its lwpid will be set after
> linux_nat_wait_1 gets the first event.  After that, lwpid of
> inferior_ptid is not zero for linux-nat target, then we can use
> ptid_get_lwp, so this function isn't needed anymore.

I'm not a specialist, but I tend to agree. I've always found
these GET_THREAD_ID macros, in particular, but be unecessary
and obfuscating.

-- 
Joel

  reply	other threads:[~2015-08-04 17:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30 12:52 Yao Qi
2015-08-04 17:30 ` Joel Brobecker [this message]
2015-08-04 21:57   ` Kevin Buettner
2015-08-05  7:42     ` Yao Qi

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=20150804173043.GK4777@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).