Non-stop mode support.
[deliverable/binutils-gdb.git] / gdb / gdbserver / target.c
index 3bdc469e7895dbc5c7f2d2012f0ec7b4f950eea9..b570b6c688635813f260c9346ee2e727e4ec6c0b 100644 (file)
@@ -89,14 +89,27 @@ write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr,
 }
 
 unsigned long
-mywait (struct target_waitstatus *ourstatus, int connected_wait)
+mywait (struct target_waitstatus *ourstatus, int options,
+       int connected_wait)
 {
   unsigned long ret;
 
   if (connected_wait)
     server_waiting = 1;
 
-  ret = (*the_target->wait) (ourstatus);
+  ret = (*the_target->wait) (ourstatus, options);
+
+  if (ourstatus->kind == TARGET_WAITKIND_EXITED
+      || ourstatus->kind == TARGET_WAITKIND_SIGNALLED)
+    {
+      if (ourstatus->kind == TARGET_WAITKIND_EXITED)
+       fprintf (stderr,
+                "\nChild exited with status %d\n", ourstatus->value.sig);
+      if (ourstatus->kind == TARGET_WAITKIND_SIGNALLED)
+       fprintf (stderr, "\nChild terminated with signal = 0x%x (%s)\n",
+                target_signal_to_host (ourstatus->value.sig),
+                target_signal_to_name (ourstatus->value.sig));
+    }
 
   if (connected_wait)
     server_waiting = 0;
@@ -104,6 +117,20 @@ mywait (struct target_waitstatus *ourstatus, int connected_wait)
   return ret;
 }
 
+int
+start_non_stop (int nonstop)
+{
+  if (the_target->start_non_stop == NULL)
+    {
+      if (nonstop)
+       return -1;
+      else
+       return 0;
+    }
+
+  return (*the_target->start_non_stop) (nonstop);
+}
+
 void
 set_target_ops (struct target_ops *target)
 {
This page took 0.025263 seconds and 4 git commands to generate.