This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Remove get_thread_id
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 4 Aug 2015 10:30:43 -0700
- Subject: Re: [PATCH] Remove get_thread_id
- Authentication-results: sourceware.org; auth=none
- References: <1438260744-14116-1-git-send-email-yao dot qi at linaro dot 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