aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-07-27 02:49:50 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-28 02:30:49 -0400
commit6558ba2b5cc3a2f22039db30616fcd07c1b28ac8 (patch)
treeca54768376c6b32a308cc728a72ebcb978e3f179
parente2075f79a99b45a6cc10de021c93f07212098a84 (diff)
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>
-rw-r--r--arch/powerpc/kernel/signal.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c
index 2b5eaa6c8f33..e74aa0ed4e9e 100644
--- a/arch/powerpc/kernel/signal.c
+++ b/arch/powerpc/kernel/signal.c
@@ -9,7 +9,7 @@
9 * this archive for more details. 9 * this archive for more details.
10 */ 10 */
11 11
12#include <linux/ptrace.h> 12#include <linux/tracehook.h>
13#include <linux/signal.h> 13#include <linux/signal.h>
14#include <asm/uaccess.h> 14#include <asm/uaccess.h>
15#include <asm/unistd.h> 15#include <asm/unistd.h>
@@ -177,6 +177,12 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
177 * its frame, and we can clear the TLF_RESTORE_SIGMASK flag. 177 * its frame, and we can clear the TLF_RESTORE_SIGMASK flag.
178 */ 178 */
179 current_thread_info()->local_flags &= ~_TLF_RESTORE_SIGMASK; 179 current_thread_info()->local_flags &= ~_TLF_RESTORE_SIGMASK;
180
181 /*
182 * Let tracing know that we've done the handler setup.
183 */
184 tracehook_signal_handler(signr, &info, &ka, regs,
185 test_thread_flag(TIF_SINGLESTEP));
180 } 186 }
181 187
182 return ret; 188 return ret;