From: Mark Kettenis Date: Sat, 27 Sep 2003 19:32:53 +0000 (+0000) Subject: * regcache.h (get_regcache_arch): New prototype. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=41d35cb0fe5aff6050e3dce2506a51876d10d26a;p=binutils-gdb.git * regcache.h (get_regcache_arch): New prototype. * regcache.c (get_regcache_arch): New function. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4b267bd1d73..6bf05490bcb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ 2003-09-27 Mark Kettenis + * regcache.h (get_regcache_arch): New prototype. + * regcache.c (get_regcache_arch): New function. + * x86-64-tdep.c (x86_64_store_return_value): Remove spurious whitespace. diff --git a/gdb/regcache.c b/gdb/regcache.c index 182ca55b426..7fc35ad9ea2 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -344,6 +344,14 @@ make_cleanup_regcache_xfree (struct regcache *regcache) return make_cleanup (do_regcache_xfree, regcache); } +/* Return REGCACHE's architecture. */ + +struct gdbarch * +get_regcache_arch (const struct regcache *regcache) +{ + return regcache->descr->gdbarch; +} + /* Return a pointer to register REGNUM's buffer cache. */ static char * diff --git a/gdb/regcache.h b/gdb/regcache.h index b8ac182fa56..c89570d245c 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -32,6 +32,10 @@ void regcache_xfree (struct regcache *regcache); struct cleanup *make_cleanup_regcache_xfree (struct regcache *regcache); struct regcache *regcache_xmalloc (struct gdbarch *gdbarch); +/* Return REGCACHE's architecture. */ + +extern struct gdbarch *get_regcache_arch (const struct regcache *regcache); + /* Transfer a raw register [0..NUM_REGS) between core-gdb and the regcache. */