This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 14/15] Introduce common_get_thread_regcache
- From: Gary Benson <gbenson at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 16 Jul 2014 14:29:21 +0100
- Subject: Re: [PATCH 14/15] Introduce common_get_thread_regcache
- Authentication-results: sourceware.org; auth=none
- References: <1404902255-11101-1-git-send-email-gbenson at redhat dot com> <1404902255-11101-15-git-send-email-gbenson at redhat dot com> <21444 dot 12512 dot 877645 dot 178584 at ruffy dot mtv dot corp dot google dot com>
Doug Evans wrote:
> Gary Benson writes:
> > This introduces common_get_thread_regcache so that we can simplify
> > nat/linux-btrace.c. A better long term solution would be unify the
> > regcache code, but this is sufficient for now.
> >
> > gdb/
> > 2014-07-09 Tom Tromey <tromey@redhat.com>
> > Gary Benson <gbenson@redhat.com>
> >
> > * regcache.h (common_get_thread_regcache): Declare.
> > * regcache.c (common_get_thread_regcache): New function.
> > * nat/linux-btrace.h (common_get_thread_regcache): Declare.
> > * nat/linux-btrace.c (perf_event_read_bts): Use
> > common_get_thread_regcache.
>
> When I think of "btrace" I don't think of "regcache". Can
> common_get_thread_regcache go some place other than linux-btrace.h?
>
> Also, why declare the function in two places? I would expect it to
> be declared once in a common header.
>
> Lastly, common_get_thread_regcache feels a bit weird as the name for
> this function. get_thread_regcache_for_ptid, or some such, feels
> better.
I renamed it get_thread_regcache_for_ptid and put it in its own
header, common/common-regcache.h.
Thanks,
Gary
--
http://gbenson.net/