This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Remove get_thread_id


On Tue, 4 Aug 2015 10:30:43 -0700
Joel Brobecker <brobecker@adacore.com> wrote:

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

Yao's patch looks good to me too.

Kevin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]