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 14/15] Introduce common_get_thread_regcache


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/


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