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: Doug Evans <dje at google dot com>
- To: Gary Benson <gbenson at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 14 Jul 2014 12:34:56 -0700
- 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>
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.
Cheers.