This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH]: New maintainer command "flushregs"
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [PATCH]: New maintainer command "flushregs"
- From: Michael Snyder <msnyder at redhat dot com>
- Date: Fri, 01 Sep 2000 11:00:36 -0700
- Organization: Red Hat, Inc.
I added this to help with testing register fetch and store.
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.
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.9
diff -p -r1.9 regcache.c
*** regcache.c 2000/08/25 21:03:00 1.9
--- regcache.c 2000/09/01 17:58:00
***************
*** 24,29 ****
--- 24,30 ----
#include "inferior.h"
#include "target.h"
#include "gdbarch.h"
+ #include "gdbcmd.h"
/*
* DATA STRUCTURE
*************** write_fp (CORE_ADDR val)
*** 867,873 ****
--- 868,885 ----
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)
{
/* We allocate some extra slop since we do a lot of memcpy's around
*************** _initialize_regcache (void)
*** 889,892 ****
--- 901,907 ----
register_gdbarch_swap (®isters, sizeof (registers), NULL);
register_gdbarch_swap (®ister_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)");
}