Replace ../include/wait.h with gdb_wait.h.
[deliverable/binutils-gdb.git] / gdb / hppah-nat.c
index 03157ed2ecab04cb7b479b87a117122c4a3c251f..abc55fcd9332f156bd241f0b3445b63cd9a993aa 100644 (file)
@@ -438,7 +438,7 @@ child_post_follow_vfork (parent_pid, followed_parent, child_pid, followed_child)
 /* Format a process id, given PID.  Be sure to terminate
    this with a null--it's going to be printed via a "%s".  */
 char *
-hppa_pid_to_str (pid)
+child_pid_to_str (pid)
      pid_t pid;
 {
   /* Static because address returned */
@@ -658,7 +658,7 @@ hppa_pid_or_tid_to_str (id)
      pid_t id;
 {
   /* In the ptrace world, there are only processes. */
-  return hppa_pid_to_str (id);
+  return child_pid_to_str (id);
 }
 
 /* This function has no meaning in a non-threaded world.  Thus, we
@@ -698,6 +698,8 @@ require_notification_of_events (pid)
 #if defined(PT_SET_EVENT_MASK)
   int pt_status;
   ptrace_event_t ptrace_events;
+  int nsigs;
+  int signum;
 
   /* Instruct the kernel as to the set of events we wish to be
      informed of.  (This support does not exist before HPUX 10.0.
@@ -709,7 +711,29 @@ require_notification_of_events (pid)
      the kernel to keep certain signals hidden from us, we do it
      by calling sigdelset (ptrace_events.pe_signals, signal) for
      each such signal here, before doing PT_SET_EVENT_MASK.  */
-  sigemptyset (&ptrace_events.pe_signals);
+  /* RM: The above comment is no longer true. We start with ignoring
+     all signals, and then add the ones we are interested in. We could
+     do it the other way: start by looking at all signals and then
+     deleting the ones that we aren't interested in, except that
+     multiple gdb signals may be mapped to the same host signal
+     (eg. TARGET_SIGNAL_IO and TARGET_SIGNAL_POLL both get mapped to
+     signal 22 on HPUX 10.20) We want to be notified if we are
+     interested in either signal.  */
+  sigfillset (&ptrace_events.pe_signals);
+
+  /* RM: Let's not bother with signals we don't care about */
+  nsigs = (int) TARGET_SIGNAL_LAST;
+  for (signum = nsigs; signum > 0; signum--)
+    {
+      if ((signal_stop_state (signum)) ||
+         (signal_print_state (signum)) ||
+         (!signal_pass_state (signum)))
+       {
+         if (target_signal_to_host_p (signum))
+           sigdelset (&ptrace_events.pe_signals,
+                      target_signal_to_host (signum));
+       }
+    }
 
   ptrace_events.pe_set_event = 0;
 
This page took 0.024325 seconds and 4 git commands to generate.