daily update
[deliverable/binutils-gdb.git] / gdb / remote-sds.c
index 7d2f5477ec3dec1ee47c9de6c89e4441b7f40dc0..507ac5be208a0a8ee8e90403c227bda3439d2bb7 100644 (file)
@@ -1,5 +1,7 @@
 /* Remote target communications for serial-line targets using SDS' protocol.
-   Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+   Foundation, Inc.
 
    This file is part of GDB.
 
@@ -127,7 +129,7 @@ static int sds_timeout = 2;
    that sds_open knows that we don't have a file open when the program
    starts.  */
 
-static serial_t sds_desc = NULL;
+static struct serial *sds_desc = NULL;
 
 /* This limit comes from the monitor.  */
 
@@ -151,7 +153,7 @@ static void
 sds_close (int quitting)
 {
   if (sds_desc)
-    SERIAL_CLOSE (sds_desc);
+    serial_close (sds_desc);
   sds_desc = NULL;
 }
 
@@ -166,8 +168,8 @@ sds_start_remote (PTR dummy)
   immediate_quit++;            /* Allow user to interrupt it */
 
   /* Ack any packet which the remote side has already sent.  */
-  SERIAL_WRITE (sds_desc, "{#*\r\n", 5);
-  SERIAL_WRITE (sds_desc, "{#}\r\n", 5);
+  serial_write (sds_desc, "{#*\r\n", 5);
+  serial_write (sds_desc, "{#}\r\n", 5);
 
   while ((c = readchar (1)) >= 0)
     printf_unfiltered ("%c", c);
@@ -201,25 +203,25 @@ device is attached to the remote system (e.g. /dev/ttya).");
 
   unpush_target (&sds_ops);
 
-  sds_desc = SERIAL_OPEN (name);
+  sds_desc = serial_open (name);
   if (!sds_desc)
     perror_with_name (name);
 
   if (baud_rate != -1)
     {
-      if (SERIAL_SETBAUDRATE (sds_desc, baud_rate))
+      if (serial_setbaudrate (sds_desc, baud_rate))
        {
-         SERIAL_CLOSE (sds_desc);
+         serial_close (sds_desc);
          perror_with_name (name);
        }
     }
 
 
-  SERIAL_RAW (sds_desc);
+  serial_raw (sds_desc);
 
   /* If there is something sitting in the buffer we might take it as a
      response to a command, which would be bad.  */
-  SERIAL_FLUSH_INPUT (sds_desc);
+  serial_flush_input (sds_desc);
 
   if (from_tty)
     {
@@ -403,7 +405,7 @@ interrupt_query (void)
 Give up (and stop debugging it)? "))
     {
       target_mourn_inferior ();
-      return_to_top_level (RETURN_QUIT);
+      throw_exception (RETURN_QUIT);
     }
 
   target_terminal_inferior ();
@@ -658,8 +660,7 @@ sds_read_bytes (CORE_ADDR memaddr, char *myaddr, int len)
 /* ARGSUSED */
 static int
 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)
+                struct mem_attrib *attrib, struct target_ops *target)
 {
   int res;
 
@@ -688,7 +689,7 @@ readchar (int timeout)
 {
   int ch;
 
-  ch = SERIAL_READCHAR (sds_desc, timeout);
+  ch = serial_readchar (sds_desc, timeout);
 
   if (remote_debug > 1 && ch >= 0)
     fprintf_unfiltered (gdb_stdlog, "%c(%x)", ch, ch);
@@ -799,7 +800,7 @@ putmessage (unsigned char *buf, int len)
                              header[0], header[1], header[2]);
          gdb_flush (gdb_stdlog);
        }
-      if (SERIAL_WRITE (sds_desc, buf2, p - buf2))
+      if (serial_write (sds_desc, buf2, p - buf2))
        perror_with_name ("putmessage: write failed");
 
       return 1;
This page took 0.025556 seconds and 4 git commands to generate.