2000-09-01 Michael Snyder <msnyder@cleaver.cygnus.com>
authorMichael Snyder <msnyder@vmware.com>
Fri, 1 Sep 2000 17:59:26 +0000 (17:59 +0000)
committerMichael Snyder <msnyder@vmware.com>
Fri, 1 Sep 2000 17:59:26 +0000 (17:59 +0000)
        * regcache.c (reg_flush_command): New function.  Maintainer-mode
        command, flushes GDB's register cache, for testing purposes.

gdb/ChangeLog
gdb/regcache.c

index 1040d557d9003f1325ce3c51f5b7783543f97a38..6f0bc08067e67702d1b713ada5e4c62a73ed5195 100644 (file)
@@ -1,3 +1,8 @@
+2000-09-01  Michael Snyder  <msnyder@cleaver.cygnus.com>
+
+       * regcache.c (reg_flush_command): New function.  Maintainer-mode
+       command, flushes GDB's register cache, for testing purposes.
+
 2000-08-31  J.T. Conklin  <jtc@redback.com>
 
        * dcache.c (dcache_info): Output a cache line's state vector so it
index c7bf6dcc091d35b670266000e3654c8121b575f7..b46a24289243fa4da820f14c46a2f302d3505ac0 100644 (file)
@@ -24,6 +24,7 @@
 #include "inferior.h"
 #include "target.h"
 #include "gdbarch.h"
+#include "gdbcmd.h"
 
 /*
  * DATA STRUCTURE
@@ -867,6 +868,17 @@ write_fp (CORE_ADDR val)
   TARGET_WRITE_FP (val);
 }
 
+/* ARGSUSED */
+static void
+reg_flush_command (char *command, int from_tty)
+{
+  /* Force-flush the register cache.  */
+  registers_changed ();
+  if (from_tty)
+    printf_filtered ("Register cache flushed.\n");
+}
+
+
 static void
 build_regcache (void)
 {
@@ -889,4 +901,7 @@ _initialize_regcache (void)
   register_gdbarch_swap (&registers, sizeof (registers), NULL);
   register_gdbarch_swap (&register_valid, sizeof (register_valid), NULL);
   register_gdbarch_swap (NULL, 0, build_regcache);
+
+  add_com ("flushregs", class_maintenance, reg_flush_command,
+          "Force gdb to flush its register cache (maintainer command)");
 }