From 361c8ade9c3c88cf7f0111fdab3ceb03028842bc Mon Sep 17 00:00:00 2001 From: Gary Benson Date: Fri, 12 Sep 2014 10:11:42 +0100 Subject: Introduce common-regcache.h This introduces common-regcache.h. This contains two functions that allow nat/linux-btrace.c to be simplified. A better long term solution would be unify the regcache code, but this is sufficient for now. gdb/ChangeLog: * common/common-regcache.h: New file. * Makefile.in (HFILES_NO_SRCDIR): Add common/common-regcache.h. * regcache.h: Include common-regcache.h. (regcache_read_pc): Don't declare. * regcache.c (get_thread_regcache_for_ptid): New function. * nat/linux-btrace.c: Don't include regcache.h. Include common-regcache.h. (perf_event_read_bts): Use get_thread_regcache_for_ptid. gdb/gdbserver/ChangeLog: * regcache.h: Include common-regcache.h. (regcache_read_pc): Don't declare. * regcache.c (get_thread_regcache_for_ptid): New function. --- gdb/regcache.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gdb/regcache.h') diff --git a/gdb/regcache.h b/gdb/regcache.h index 0e0b84b..c00da84 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -20,6 +20,8 @@ #ifndef REGCACHE_H #define REGCACHE_H +#include "common-regcache.h" + struct regcache; struct regset; struct gdbarch; @@ -136,7 +138,7 @@ void regcache_cooked_write_part (struct regcache *regcache, int regnum, /* Special routines to read/write the PC. */ -extern CORE_ADDR regcache_read_pc (struct regcache *regcache); +/* For regcache_read_pc see common/common-regcache.h. */ extern void regcache_write_pc (struct regcache *regcache, CORE_ADDR pc); /* Transfer a raw register [0..NUM_REGS) between the regcache and the -- cgit v1.1