* serial.h (SERIAL_SET_TTY_STATE): Comment return value.
[deliverable/binutils-gdb.git] / gdb / remote-mips.c
index ed27e4dfb39374ebc25fa0bd1192729f6571d09e..0c5ee6e77b6ca98a2275bfffdf38cbb49f80efb9 100644 (file)
@@ -58,7 +58,7 @@ static int mips_receive_packet PARAMS ((char *buff, int throw_error,
 
 static int
 mips_request PARAMS ((char cmd, unsigned int addr, unsigned int data,
-                     int *perr, timeout));
+                     int *perr, int timeout));
 
 static void
 mips_initialize PARAMS ((void));
@@ -76,7 +76,7 @@ static void mips_resume PARAMS ((int pid, int step,
                                 enum target_signal siggnal));
 
 static int
-mips_wait PARAMS ((int pid, WAITTYPE *status));
+mips_wait PARAMS ((int pid, struct target_waitstatus *status));
 
 static int
 mips_map_regno PARAMS ((int regno));
@@ -888,6 +888,13 @@ mips_request (cmd, addr, data, perr, timeout)
   return rresponse;
 }
 
+static void
+mips_initialize_cleanups (arg)
+     PTR arg;
+{
+  mips_initializing = 0;
+}
+
 /* Initialize a new connection to the MIPS board, and make sure we are
    really connected.  */
 
@@ -897,9 +904,16 @@ mips_initialize ()
   char cr;
   char buff[DATA_MAXLEN + 1];
   int err;
+  struct cleanup *old_cleanups = make_cleanup (mips_initialize_cleanups, NULL);
 
+  /* What is this code doing here?  I don't see any way it can happen, and
+     it might mean mips_initializing didn't get cleared properly.
+     So I'll make it a warning.  */
   if (mips_initializing)
-    return;
+    {
+      warning ("internal error: mips_initialize called twice");
+      return;
+    }
 
   mips_initializing = 1;
 
@@ -929,7 +943,7 @@ mips_initialize ()
     }
   mips_receive_packet (buff, 1, 3);
 
-  mips_initializing = 0;
+  do_cleanups (old_cleanups);
 
   /* If this doesn't call error, we have connected; we don't care if
      the request itself succeeds or fails.  */
@@ -1369,8 +1383,10 @@ struct target_ops mips_ops =
 {
   "mips",                      /* to_shortname */
   "Remote MIPS debugging over serial line",    /* to_longname */
-  "Debug a board using the MIPS remote debugging protocol over a serial line.\n\
-Specify the serial device it is connected to (e.g., /dev/ttya).",  /* to_doc */
+  "\
+Debug a board using the MIPS remote debugging protocol over a serial line.\n\
+The argument is the device it is connected to or, if it contains a colon,\n\
+HOST:PORT to access a board over a network",  /* to_doc */
   mips_open,                   /* to_open */
   mips_close,                  /* to_close */
   NULL,                                /* to_attach */
This page took 0.023865 seconds and 4 git commands to generate.