aboutsummaryrefslogtreecommitdiff
path: root/gdb/inflow.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1994-07-23 00:53:28 +0000
committerStu Grossman <grossman@cygnus>1994-07-23 00:53:28 +0000
commitcad1498f8a8aaa41ca54ffdde76263740372975a (patch)
treeeaf8dfd3a65cdb20fc02c37c7ec9ae5c44dad53f /gdb/inflow.c
parentf2c2e75ce090e3a012a942077587b2acc948e4ee (diff)
downloadgdb-cad1498f8a8aaa41ca54ffdde76263740372975a.zip
gdb-cad1498f8a8aaa41ca54ffdde76263740372975a.tar.gz
gdb-cad1498f8a8aaa41ca54ffdde76263740372975a.tar.bz2
* Makefile.in: Add stuff to build nlmstub.
* Add rule for annotate.o to keep Sun make happy. * configure.in: Add config for powerpc/Netware. * partial-stab.h (near N_SO): Don't call START_PSYMTAB with null filename. This speeds up handling of trailing N_SO stabs (they mark the end of a .o file). * target.c, target.h: Change the way pushing and popping of targets work to support target overlays and inheritance. * corelow.c, hppa-tdep.c, inflow.c, remote-nindy.c, utils.c: Fixup references to current_target, due to previous changes. * config/i386/tm-i386nw.h: Enable longjmp support. More work is needed to get the address of longjmp out of the target.
Diffstat (limited to 'gdb/inflow.c')
-rw-r--r--gdb/inflow.c63
1 files changed, 62 insertions, 1 deletions
diff --git a/gdb/inflow.c b/gdb/inflow.c
index 4ccbd36..0956142 100644
--- a/gdb/inflow.c
+++ b/gdb/inflow.c
@@ -545,7 +545,7 @@ kill_command (arg, from_tty)
/* Killing off the inferior can leave us with a core file. If so,
print the state we are left in. */
if (target_has_stack) {
- printf_filtered ("In %s,\n", current_target->to_longname);
+ printf_filtered ("In %s,\n", target_longname);
if (selected_frame == NULL)
fputs_filtered ("No selected stack frame.\n", gdb_stdout);
else
@@ -578,6 +578,67 @@ clear_sigint_trap()
signal (SIGINT, osig);
}
+#if defined (SIGIO) && defined (FASYNC) && defined (FD_SET)
+static void (*old_sigio) ();
+
+static void
+handle_sigio (signo)
+ int signo;
+{
+ int numfds;
+ fd_set readfds;
+
+ signal (SIGIO, handle_sigio);
+
+ FD_ZERO (&readfds);
+ FD_SET (target_activity_fd, &readfds);
+ numfds = select (target_activity_fd + 1, &readfds, NULL, NULL, NULL);
+ if (numfds >= 0 && FD_ISSET (target_activity_fd, &readfds))
+ {
+ if ((*target_activity_function) ())
+ kill (inferior_pid, SIGINT);
+ }
+}
+
+static int old_fcntl_flags;
+
+void
+set_sigio_trap ()
+{
+ 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 ()
+{
+ if (target_activity_function)
+ {
+ signal (SIGIO, old_sigio);
+ fcntl (target_activity_fd, F_SETFL, old_fcntl_flags);
+ }
+}
+#else /* No SIGIO. */
+void
+set_sigio_trap ()
+{
+ if (target_activity_function)
+ abort ();
+}
+
+void
+clear_sigio_trap ()
+{
+ if (target_activity_function)
+ abort ();
+}
+#endif /* No SIGIO. */
+
/* This is here because this is where we figure out whether we (probably)
have job control. Just using job_control only does part of it because