OSDN Git Service

* exec.c (xfer_memory): Add attrib argument.
[pf3gnuchains/pf3gnuchains4x.git] / gdb / remote-sds.c
index 582d46b..56e61b6 100644 (file)
@@ -1,5 +1,5 @@
 /* Remote target communications for serial-line targets using SDS' protocol.
-   Copyright 1997 Free Software Foundation, Inc.
+   Copyright 1997, 2001 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -37,7 +37,6 @@
 #include "gdb-stabs.h"
 #include "gdbthread.h"
 #include "gdbcore.h"
-#include "dcache.h"
 
 #ifdef USG
 #include <sys/types.h>
@@ -56,7 +55,8 @@ static int sds_read_bytes (CORE_ADDR, char *, int);
 
 static void sds_files_info (struct target_ops *ignore);
 
-static int sds_xfer_memory (CORE_ADDR, char *, int, int, struct target_ops *);
+static int sds_xfer_memory (CORE_ADDR, char *, int, int, 
+                           struct mem_attrib *, struct target_ops *);
 
 static void sds_prepare_to_store (void);
 
@@ -163,7 +163,7 @@ sds_start_remote (PTR dummy)
   char c;
   unsigned char buf[200];
 
-  immediate_quit = 1;          /* Allow user to interrupt it */
+  immediate_quit++;            /* Allow user to interrupt it */
 
   /* Ack any packet which the remote side has already sent.  */
   SERIAL_WRITE (sds_desc, "{#*\r\n", 5);
@@ -181,7 +181,7 @@ sds_start_remote (PTR dummy)
   buf[0] = 0;
   sds_send (buf, 1);
 
-  immediate_quit = 0;
+  immediate_quit--;
 
   start_remote ();             /* Initialize gdb process mechanisms */
   return 1;
@@ -190,8 +190,6 @@ sds_start_remote (PTR dummy)
 /* Open a connection to a remote debugger.
    NAME is the filename used for communication.  */
 
-static DCACHE *sds_dcache;
-
 static void
 sds_open (char *name, int from_tty)
 {
@@ -203,11 +201,6 @@ device is attached to the remote system (e.g. /dev/ttya).");
 
   unpush_target (&sds_ops);
 
-  if (!sds_dcache)
-    sds_dcache = dcache_init (sds_read_bytes, sds_write_bytes);
-  else
-    dcache_invd (sds_dcache);
-
   sds_desc = SERIAL_OPEN (name);
   if (!sds_desc)
     perror_with_name (name);
@@ -358,8 +351,6 @@ sds_resume (int pid, int step, enum target_signal siggnal)
 {
   unsigned char buf[PBUFSIZ];
 
-  dcache_invd (sds_dcache);
-
   last_sent_signal = siggnal;
   last_sent_step = step;
 
@@ -662,18 +653,22 @@ sds_read_bytes (CORE_ADDR memaddr, char *myaddr, int len)
 /* Read or write LEN bytes from inferior memory at MEMADDR,
    transferring to or from debugger address MYADDR.  Write to inferior
    if SHOULD_WRITE is nonzero.  Returns length of data written or
-   read; 0 for error.  */
+   read; 0 for error.  TARGET is unused.  */
 
 /* ARGSUSED */
 static int
-sds_xfer_memory (memaddr, myaddr, len, should_write, target)
-     CORE_ADDR memaddr;
-     char *myaddr;
-     int len;
-     int should_write;
-     struct target_ops *target;        /* ignored */
+sds_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int should_write,
+                struct mem_attrib *attrib ATTRIBUTE_UNUSED,
+                struct target_ops *target ATTRIBUTE_UNUSED)
 {
-  return dcache_xfer_memory (sds_dcache, memaddr, myaddr, len, should_write);
+  int res;
+
+  if (should_write)
+    res = sds_write_bytes (memaddr, myaddr, len);
+  else
+    res = sds_read_bytes (memaddr, myaddr, len);
+  
+  return res;
 }
 \f