]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
powerpc: Call tracehook_signal_handler() when setting up signal frames
authorRoland McGrath <roland@redhat.com>
Sun, 27 Jul 2008 06:49:50 +0000 (16:49 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 28 Jul 2008 06:30:49 +0000 (16:30 +1000)
This makes the powerpc signal handling code call tracehook_signal_handler()
after a handler is set up.  This means that using PTRACE_SINGLESTEP to
enter a signal handler will report to ptrace on the first instruction of
the handler, instead of the second.  This is consistent with what x86 and
other machines do, and what users and debuggers want.

BenH: Fixed up the test for the trap value.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/signal.c

index 2b5eaa6c8f33f9004fdc6f277656cb70c3aba0ef..e74aa0ed4e9ef0e931e2157757d4dd5ecc9d8999 100644 (file)
@@ -9,7 +9,7 @@
  * this archive for more details.
  */
 
-#include <linux/ptrace.h>
+#include <linux/tracehook.h>
 #include <linux/signal.h>
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
@@ -177,6 +177,12 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
                 * its frame, and we can clear the TLF_RESTORE_SIGMASK flag.
                 */
                current_thread_info()->local_flags &= ~_TLF_RESTORE_SIGMASK;
+
+               /*
+                * Let tracing know that we've done the handler setup.
+                */
+               tracehook_signal_handler(signr, &info, &ka, regs,
+                                        test_thread_flag(TIF_SINGLESTEP));
        }
 
        return ret;