sim_stop_reason (&reason, &sigrc);
gdbsim_wait (pid, status)     int pid;     struct target_waitstatus *status;{  int sigrc;  enum sim_stop reason;  if (sr_get_debug ())    printf_filtered ("gdbsim_wait\n");  sim_stop_reason (&reason, &sigrc);  switch (reason)    {    case sim_exited:      status->kind = TARGET_WAITKIND_EXITED;      status->value.integer = sigrc;      break;    case sim_stopped:      status->kind = TARGET_WAITKIND_STOPPED;      /* The signal in sigrc is a host signal.  That probably	 should be fixed.  */      status->value.sig = target_signal_from_host (sigrc);      break;    case sim_signalled:      status->kind = TARGET_WAITKIND_SIGNALLED;      /* The signal in sigrc is a host signal.  That probably	 should be fixed.  */      status->value.sig = target_signal_from_host (sigrc);      break;    }  return inferior_pid;}