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] Zap some not-needed regcache interfaces


Hello,

In getting ready for the next regcache patch, I found I could simplify things a little and eliminate a number of the regcache interfaces I'd added and was using on the branch. Applying the `keep it simple s..' rule I've removed the redundancy.

committed,
Andrew

2002-06-22  Andrew Cagney  <ac131313@redhat.com>

	* regcache.h: Update comments describing the regcache_cpy family
	of functions.
	(regcache_save, regcache_restore): Delete declaration.
	(regcache_save_no_passthrough): Delete declaration.
	(regcache_restore_no_passthrough): Delete declaration.
	* regcache.c (regcache_save): Delete function.
	(regcache_save_no_passthrough): Delete function.
	(regcache_restore): Delete function.
	(regcache_restore_no_passthrough): Delete function.

Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.37
diff -u -r1.37 regcache.c
--- regcache.c	20 Jun 2002 03:13:51 -0000	1.37
+++ regcache.c	22 Jun 2002 21:13:20 -0000
@@ -1186,41 +1186,6 @@
 }
 
 void
-regcache_save (struct regcache *regcache)
-{
-  int i;
-  gdb_assert (current_regcache != NULL && regcache != NULL);
-  gdb_assert (current_regcache->descr->gdbarch == regcache->descr->gdbarch);
-  regcache_cpy (regcache, current_regcache);
-}
-
-void
-regcache_save_no_passthrough (struct regcache *regcache)
-{
-  gdb_assert (current_regcache != NULL && regcache != NULL);
-  gdb_assert (current_regcache->descr->gdbarch == regcache->descr->gdbarch);
-  regcache_cpy_no_passthrough (regcache, current_regcache);
-}
-
-void
-regcache_restore (struct regcache *regcache)
-{
-  int i;
-  gdb_assert (current_regcache != NULL && regcache != NULL);
-  gdb_assert (current_regcache->descr->gdbarch == regcache->descr->gdbarch);
-  regcache_cpy (current_regcache, regcache);
-}
-
-void
-regcache_restore_no_passthrough (struct regcache *regcache)
-{
-  char *regcache_registers;
-  gdb_assert (current_regcache != NULL && regcache != NULL);
-  gdb_assert (current_regcache->descr->gdbarch == regcache->descr->gdbarch);
-  regcache_cpy_no_passthrough (current_regcache, regcache);
-}
-
-void
 _initialize_regcache (void)
 {
   regcache_descr_handle = register_gdbarch_data (init_regcache_descr,
Index: regcache.h
===================================================================
RCS file: /cvs/src/src/gdb/regcache.h,v
retrieving revision 1.7
diff -u -r1.7 regcache.h
--- regcache.h	20 Jun 2002 03:13:51 -0000	1.7
+++ regcache.h	22 Jun 2002 21:13:20 -0000
@@ -58,18 +58,16 @@
 
 extern signed char *register_valid;
 
-/* Save/restore the register cache using the regbuf.  The operation is
-   write through - it is strictly for code that needs to restore the
-   target's registers to a previous state.
+/* Copy/duplicate the contents of a register cache.  By default, the
+   operation is pass-through.  Writes to DST and reads from SRC will
+   go through to the target.
+
+   The ``cpy'' functions can not have overlapping SRC and DST buffers.
 
    ``no passthrough'' versions do not go through to the target.  They
-   only save values already in the cache.  */
+   only transfer values already in the cache.  */
 
-extern void regcache_save (struct regcache *regcache);
-extern void regcache_restore (struct regcache *regcache);
 extern struct regcache *regcache_dup (struct regcache *regcache);
-extern void regcache_save_no_passthrough (struct regcache *regcache);
-extern void regcache_restore_no_passthrough (struct regcache *regcache);
 extern struct regcache *regcache_dup_no_passthrough (struct regcache *regcache);
 extern void regcache_cpy (struct regcache *dest, struct regcache *src);
 extern void regcache_cpy_no_passthrough (struct regcache *dest, struct regcache *src);

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