2004-10-08 Michael Chastain <mec.gnu@mindspring.com>
[deliverable/binutils-gdb.git] / gdb / monitor.c
index 198155f443f4f9826c2c7e2888f305836b2b12a6..0fb44a1100e6e07564375e72b5c3849082c34c01 100644 (file)
@@ -153,7 +153,7 @@ static void monitor_debug (const char *fmt, ...) ATTR_FORMAT(printf, 1, 2);
 static int monitor_debug_p = 0;
 
 /* NOTE: This file alternates between monitor_debug_p and remote_debug
-   when determining if debug information is printed.  Perhaphs this
+   when determining if debug information is printed.  Perhaps this
    could be simplified. */
 
 static void
@@ -921,9 +921,9 @@ monitor_supply_register (int regno, char *valstr)
 
   /* supply register stores in target byte order, so swap here */
 
-  store_unsigned_integer (regbuf, DEPRECATED_REGISTER_RAW_SIZE (regno), val);
+  store_unsigned_integer (regbuf, register_size (current_gdbarch, regno), val);
 
-  supply_register (regno, regbuf);
+  regcache_raw_supply (current_regcache, regno, regbuf);
 
   return p;
 }
@@ -1184,7 +1184,7 @@ monitor_fetch_register (int regno)
   if (!name || (*name == '\0'))
     {
       monitor_debug ("No register known for %d\n", regno);
-      supply_register (regno, zerobuf);
+      regcache_raw_supply (current_regcache, regno, zerobuf);
       return;
     }
 
@@ -1227,7 +1227,7 @@ monitor_fetch_register (int regno)
      spaces, but stop reading if something else is seen.  Some monitors
      like to drop leading zeros.  */
 
-  for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno) * 2; i++)
+  for (i = 0; i < register_size (current_gdbarch, regno) * 2; i++)
     {
       int c;
       c = readchar (timeout);
@@ -1344,7 +1344,7 @@ monitor_store_register (int regno)
 
   val = read_register (regno);
   monitor_debug ("MON storeg %d %s\n", regno,
-                phex (val, DEPRECATED_REGISTER_RAW_SIZE (regno)));
+                phex (val, register_size (current_gdbarch, regno)));
 
   /* send the register deposit command */
 
@@ -1515,33 +1515,6 @@ monitor_write_memory (CORE_ADDR memaddr, char *myaddr, int len)
 }
 
 
-static int
-monitor_write_even_block (CORE_ADDR memaddr, char *myaddr, int len)
-{
-  unsigned int val;
-  int written = 0;;
-  /* Enter the sub mode */
-  monitor_printf (current_monitor->setmem.cmdl, memaddr);
-  monitor_expect_prompt (NULL, 0);
-
-  while (len)
-    {
-      val = extract_unsigned_integer (myaddr, 4);      /* REALLY */
-      monitor_printf ("%x\r", val);
-      myaddr += 4;
-      memaddr += 4;
-      written += 4;
-      monitor_debug (" @ %s\n", paddr (memaddr));
-      /* If we wanted to, here we could validate the address */
-      monitor_expect_prompt (NULL, 0);
-    }
-  /* Now exit the sub mode */
-  monitor_printf (current_monitor->getreg.term_cmd);
-  monitor_expect_prompt (NULL, 0);
-  return written;
-}
-
-
 static int
 monitor_write_memory_bytes (CORE_ADDR memaddr, char *myaddr, int len)
 {
@@ -1693,17 +1666,6 @@ monitor_write_memory_block (CORE_ADDR memaddr, char *myaddr, int len)
     {
       return monitor_write_memory_longlongs (memaddr, myaddr, len);
     }
-#endif
-#if 0
-  if (len > 4)
-    {
-      int sublen;
-      written = monitor_write_even_block (memaddr, myaddr, len);
-      /* Adjust calling parameters by written amount */
-      memaddr += written;
-      myaddr += written;
-      len -= written;
-    }
 #endif
   written = monitor_write_memory_bytes (memaddr, myaddr, len);
   return written;
@@ -2049,7 +2011,8 @@ monitor_kill (void)
    the program at that point.  */
 
 static void
-monitor_create_inferior (char *exec_file, char *args, char **env)
+monitor_create_inferior (char *exec_file, char *args, char **env,
+                        int from_tty)
 {
   if (args && (*args != '\000'))
     error ("Args are not supported by the monitor.");
@@ -2331,14 +2294,15 @@ void
 _initialize_remote_monitors (void)
 {
   init_base_monitor_ops ();
-  add_show_from_set (add_set_cmd ("hash", no_class, var_boolean,
-                                 (char *) &hashmark,
-                                 "Set display of activity while downloading a file.\n\
+  deprecated_add_show_from_set
+    (add_set_cmd ("hash", no_class, var_boolean,
+                 (char *) &hashmark,
+                 "Set display of activity while downloading a file.\n\
 When enabled, a hashmark \'#\' is displayed.",
-                                 &setlist),
-                    &showlist);
+                 &setlist),
+     &showlist);
 
-  add_show_from_set
+  deprecated_add_show_from_set
     (add_set_cmd ("monitor", no_class, var_zinteger,
                  (char *) &monitor_debug_p,
                  "Set debugging of remote monitor communication.\n\
This page took 0.026496 seconds and 4 git commands to generate.