+#ifdef SIM_HAVE_ENVIRONMENT
+ /* NOTE: An old simulator supporting the operating environment MUST
+ provide sim_set_trace() and not sim_trace(). That way
+ sim_stop_reason() can be used to determine any stop reason. */
+ if (trace)
+ sim_set_trace ();
+ sigrc = 0;
+ do
+ {
+ prev_sigint = signal (SIGINT, cntrl_c);
+ sim_resume (sd, 0, sigrc);
+ signal (SIGINT, prev_sigint);
+ sim_stop_reason (sd, &reason, &sigrc);
+ }
+ while (operating_p && reason == sim_stopped && sigrc != SIGINT);
+#else