It turns out that 1.2 wasn't botched after all. (I was failing to take
[deliverable/binutils-gdb.git] / gdb / hppah-nat.c
index 11e9d02c2359c169d6df33453f5121225d36f0ca..67e507cc348b40fe7f2859cfbd3873fee666a526 100644 (file)
@@ -28,7 +28,7 @@
 #include "target.h"
 #include <sys/ptrace.h>
 #include "gdbcore.h"
-#include <wait.h>
+#include "gdb_wait.h"
 #include <signal.h>
 
 extern CORE_ADDR text_end;
@@ -139,6 +139,12 @@ store_inferior_registers (regno)
            }
          return;
        }
+
+      /* Another crock.  HPUX complains if you write a nonzero value to
+        the high part of IPSW.  What will it take for HP to catch a
+        clue about building sensible interfaces?  */
+     if (regno == IPSW_REGNUM && len == 8)
+       *(int *)&registers[REGISTER_BYTE (regno)] = 0;
 #endif
 
       for (i = 0; i < len; i += sizeof (int))
@@ -152,7 +158,7 @@ store_inferior_registers (regno)
                 the kernel doesn't let us at the registers. */
              char *err = safe_strerror (errno);
              char *msg = alloca (strlen (err) + 128);
-             sprintf (msg, "reading `%s' register: %s",
+             sprintf (msg, "writing `%s' register: %s",
                        REGISTER_NAME (regno), err);
              /* If we fail to write the PC, give a true error instead of
                 just a warning.  */
@@ -432,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 */
@@ -652,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
@@ -692,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.
@@ -703,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.023821 seconds and 4 git commands to generate.