This is the mail archive of the gdb-patches@sources.redhat.com 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]

[PATCH/RFC] Getting the architecture for a regcache


If nobody objects, I'll check this in somehere next week.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* regcache.h (get_regcache_arch): New prototype.
	* regcache.c (get_regcache_arch): New function.

Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.97
diff -u -p -r1.97 regcache.c
--- regcache.c 29 Aug 2003 13:04:44 -0000 1.97
+++ regcache.c 6 Sep 2003 14:37:13 -0000
@@ -342,6 +342,14 @@ make_cleanup_regcache_xfree (struct regc
   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 *
Index: regcache.h
===================================================================
RCS file: /cvs/src/src/gdb/regcache.h,v
retrieving revision 1.36
diff -u -p -r1.36 regcache.h
--- regcache.h 29 Aug 2003 09:59:28 -0000 1.36
+++ regcache.h 6 Sep 2003 14:37:13 -0000
@@ -32,6 +32,10 @@ void regcache_xfree (struct regcache *re
 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. */
 


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