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 v2 0/3] remove all_lwps from gdbserver


On 01/29/2014 05:56 PM, Doug Evans wrote:

> gdbserver for linux maintains two separate lists of each thread, and
> each list contains important data about the thread so that often the
> code needs pointers to both entries.  Alas when gdb has a pointer to
> the "lwp_info" form of the thread is does a linear search in the
> "thread_info" form of the thread list to get that part.  Yikes!
> 
> The idea behind this patch is very simple: remove all_lwps: there's no
> point in keeping two lists.
> [I could just add a backpointer from lwp_info -> thread_info, but that
> would just be a quick fix, and we're very early into 7.8 - we have
> time to do something better.  I can't think of a good reason to have
> two lists.]

I think it'd be nice if the hunks that add the backpointer, and
rewrite get_lwp_thread to not do the lookup were split to their
own patch, as we do end up with the backpointer anyway.  That's
where the whole speed up is, and what the commit log should
explain, IMHO.  Then the last patch would "just" be a cleanup
that eliminates all_lwps (justified in terms of improving
simplicity/maintenance).

-- 
Pedro Alves


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