* Makefile.in (objfiles.o, symfile.o): Update.
[deliverable/binutils-gdb.git] / gdb / dcache.c
index 45e2db7341b620156663cdd5cddfedc506ef12e2..43640b0e48e38f9e1bcb9f35ddb87a3027b5756c 100644 (file)
@@ -1,6 +1,6 @@
 /* Caching code for GDB, the GNU debugger.
 
-   Copyright 1992, 1993, 1995, 1996, 1998, 1999, 2000, 2001, 2003 Free
+   Copyright (C) 1992, 1993, 1995, 1996, 1998, 1999, 2000, 2001, 2003 Free
    Software Foundation, Inc.
 
    This file is part of GDB.
@@ -17,8 +17,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
 
 #include "defs.h"
 #include "dcache.h"
@@ -124,7 +124,7 @@ struct dcache_block
   {
     struct dcache_block *p;    /* next in list */
     CORE_ADDR addr;            /* Address for which data is recorded.  */
-    char data[LINE_SIZE];      /* bytes at given address */
+    gdb_byte data[LINE_SIZE];  /* bytes at given address */
     unsigned char state[LINE_SIZE];    /* what state the data is in */
 
     /* whether anything in state is dirty - used to speed up the 
@@ -162,10 +162,6 @@ struct dcache_struct
     struct dcache_block *the_cache;
   };
 
-static int dcache_poke_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr);
-
-static int dcache_peek_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr);
-
 static struct dcache_block *dcache_hit (DCACHE *dcache, CORE_ADDR addr);
 
 static int dcache_write_line (DCACHE *dcache, struct dcache_block *db);
@@ -181,6 +177,13 @@ static void dcache_info (char *exp, int tty);
 void _initialize_dcache (void);
 
 static int dcache_enabled_p = 0;
+static void
+show_dcache_enabled_p (struct ui_file *file, int from_tty,
+                      struct cmd_list_element *c, const char *value)
+{
+  fprintf_filtered (file, _("Cache use for remote targets is %s.\n"), value);
+}
+
 
 DCACHE *last_cache;            /* Used by info dcache */
 
@@ -243,7 +246,7 @@ static int
 dcache_write_line (DCACHE *dcache, struct dcache_block *db)
 {
   CORE_ADDR memaddr;
-  char *myaddr;
+  gdb_byte *myaddr;
   int len;
   int res;
   int reg_len;
@@ -324,7 +327,7 @@ static int
 dcache_read_line (DCACHE *dcache, struct dcache_block *db)
 {
   CORE_ADDR memaddr;
-  char *myaddr;
+  gdb_byte *myaddr;
   int len;
   int res;
   int reg_len;
@@ -443,7 +446,7 @@ dcache_writeback (DCACHE *dcache)
    Returns 0 on error. */
 
 static int
-dcache_peek_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr)
+dcache_peek_byte (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr)
 {
   struct dcache_block *db = dcache_hit (dcache, addr);
 
@@ -470,7 +473,7 @@ dcache_peek_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr)
  */
 
 static int
-dcache_poke_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr)
+dcache_poke_byte (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr)
 {
   struct dcache_block *db = dcache_hit (dcache, addr);
 
@@ -525,11 +528,11 @@ dcache_free (DCACHE *dcache)
    This routine is indended to be called by remote_xfer_ functions. */
 
 int
-dcache_xfer_memory (DCACHE *dcache, CORE_ADDR memaddr, char *myaddr, int len,
-                   int should_write)
+dcache_xfer_memory (DCACHE *dcache, CORE_ADDR memaddr, gdb_byte *myaddr,
+                   int len, int should_write)
 {
   int i;
-  int (*xfunc) (DCACHE *dcache, CORE_ADDR addr, char *ptr);
+  int (*xfunc) (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr);
   xfunc = should_write ? dcache_poke_byte : dcache_peek_byte;
 
   for (i = 0; i < len; i++)
@@ -585,20 +588,20 @@ dcache_info (char *exp, int tty)
 void
 _initialize_dcache (void)
 {
-  deprecated_add_show_from_set
-    (add_set_cmd ("remotecache", class_support, var_boolean,
-                 (char *) &dcache_enabled_p,
-                 "\
-Set cache use for remote targets.\n\
+  add_setshow_boolean_cmd ("remotecache", class_support,
+                          &dcache_enabled_p, _("\
+Set cache use for remote targets."), _("\
+Show cache use for remote targets."), _("\
 When on, use data caching for remote targets.  For many remote targets\n\
 this option can offer better throughput for reading target memory.\n\
 Unfortunately, gdb does not currently know anything about volatile\n\
 registers and thus data caching will produce incorrect results with\n\
-volatile registers are in use.  By default, this option is off.",
-                 &setlist),
-     &showlist);
+volatile registers are in use.  By default, this option is off."),
+                          NULL,
+                          show_dcache_enabled_p,
+                          &setlist, &showlist);
 
   add_info ("dcache", dcache_info,
-           "Print information on the dcache performance.");
+           _("Print information on the dcache performance."));
 
 }
This page took 0.026552 seconds and 4 git commands to generate.