* config/m68k/monitor.mt (TDEPFILE): Add remote-es.o.
[deliverable/binutils-gdb.git] / gdb / remote-udi.c
index c51c8750526715f72fec5d82d466b854ae6e5dd7..d4c634e7cbd8b639c2efa48e502024e3b114c657 100644 (file)
@@ -150,7 +150,19 @@ udi_create_inferior (execfile, args, env)
 
   args1 = alloca (strlen(execfile) + strlen(args) + 2);
 
-  strcpy (args1, execfile);
+  if (execfile[0] == '\0')
+
+    /* It is empty.  We need to quote it somehow, or else the target
+       will think there is no argument being passed here.  According
+       to the UDI spec it is quoted "according to TIP OS rules" which
+       I guess means quoting it like the Unix shell should work
+       (sounds pretty bogus to me...).  In fact it doesn't work (with
+       isstip anyway), but passing in two quotes as the argument seems
+       like a reasonable enough behavior anyway (I guess).  */
+
+    strcpy (args1, "''");
+  else
+    strcpy (args1, execfile);
   strcat (args1, " ");
   strcat (args1, args);
 
@@ -291,10 +303,15 @@ udi_close (quitting)      /*FIXME: how is quitting used */
     return;
 
   /* We should never get here if there isn't something valid in
-     udi_session_id. */
+     udi_session_id.  */
 
   if (UDIDisconnect (udi_session_id, UDITerminateSession))
-    error ("UDIDisconnect() failed in udi_close");
+    {
+      if (quitting)
+       warning ("UDIDisconnect() failed in udi_close");
+      else
+       error ("UDIDisconnect() failed in udi_close");
+    }
 
   /* Do not try to close udi_session_id again, later in the program.  */
   udi_session_id = -1;
@@ -348,8 +365,11 @@ udi_detach (args,from_tty)
   if (UDIDisconnect (udi_session_id, UDIContinueSession))
     error ("UDIDisconnect() failed in udi_detach");
 
-  pop_target();                /* calls udi_close to do the real work */
+  /* calls udi_close to do the real work (which looks like it calls
+     UDIDisconnect with UDITerminateSession, FIXME).  */
+  pop_target();
 
+  /* FIXME, message too similar to what udi_close prints.  */
   if (from_tty)
     printf_unfiltered ("Ending remote debugging\n");
 }
@@ -999,7 +1019,9 @@ just invoke udi_close, which seems to get things right.
 #endif /* 0 */
 
   /* Keep the target around, e.g. so "run" can do the right thing when
-     we are already debugging something.  */
+     we are already debugging something.  FIXME-maybe: should we kill the
+     TIP with UDIDisconnect using UDITerminateSession, and then restart
+     it on the next "run"?  */
 
   inferior_pid = 0;
 }
This page took 0.024532 seconds and 4 git commands to generate.