- select_frame ((FRAME) 0, -1);
- reopen_exec_file ();
- if (target_has_stack)
- set_current_frame ( create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
- else
- set_current_frame (0);
- /* It is confusing to the user for ignore counts to stick around
- from previous runs of the inferior. So clear them. */
- breakpoint_clear_ignore_counts ();
+static int old_fcntl_flags;
+
+void
+set_sigio_trap (void)
+{
+ if (target_activity_function)
+ {
+ old_sigio = (void (*)()) signal (SIGIO, handle_sigio);
+ fcntl (target_activity_fd, F_SETOWN, getpid ());
+ old_fcntl_flags = fcntl (target_activity_fd, F_GETFL, 0);
+ fcntl (target_activity_fd, F_SETFL, old_fcntl_flags | FASYNC);
+ }
+}
+
+void
+clear_sigio_trap (void)
+{
+ if (target_activity_function)
+ {
+ signal (SIGIO, old_sigio);
+ fcntl (target_activity_fd, F_SETFL, old_fcntl_flags);
+ }
+}
+#else /* No SIGIO. */
+void
+set_sigio_trap (void)
+{
+ if (target_activity_function)
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");