powerpc: Call tracehook_signal_handler() when setting up signal frames

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, July 28, 2008 - 10:09 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6558ba...
Commit:     6558ba2b5cc3a2f22039db30616fcd07c1b28ac8
Parent:     e2075f79a99b45a6cc10de021c93f07212098a84
Author:     Roland McGrath <roland@redhat.com>
AuthorDate: Sun Jul 27 16:49:50 2008 +1000
Committer:  Benjamin Herrenschmidt <benh@kernel.crashing.org>
CommitDate: Mon Jul 28 16:30:49 2008 +1000

    powerpc: Call tracehook_signal_handler() when setting up signal frames
    
    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 |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c
index 2b5eaa6..e74aa0e 100644
--- a/arch/powerpc/kernel/signal.c
+++ b/arch/powerpc/kernel/signal.c
@@ -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;
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
powerpc: Call tracehook_signal_handler() when setting up s ..., Linux Kernel Mailing ..., (Mon Jul 28, 10:09 am)