diff options
Diffstat (limited to 'arch/alpha/kernel/ptrace.c')
-rw-r--r-- | arch/alpha/kernel/ptrace.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c index 54616f496aed..2a4a80ff4a20 100644 --- a/arch/alpha/kernel/ptrace.c +++ b/arch/alpha/kernel/ptrace.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/user.h> | 13 | #include <linux/user.h> |
14 | #include <linux/security.h> | 14 | #include <linux/security.h> |
15 | #include <linux/signal.h> | 15 | #include <linux/signal.h> |
16 | #include <linux/tracehook.h> | ||
16 | 17 | ||
17 | #include <asm/uaccess.h> | 18 | #include <asm/uaccess.h> |
18 | #include <asm/pgtable.h> | 19 | #include <asm/pgtable.h> |
@@ -312,25 +313,18 @@ long arch_ptrace(struct task_struct *child, long request, | |||
312 | return ret; | 313 | return ret; |
313 | } | 314 | } |
314 | 315 | ||
316 | asmlinkage unsigned long syscall_trace_enter(void) | ||
317 | { | ||
318 | unsigned long ret = 0; | ||
319 | if (test_thread_flag(TIF_SYSCALL_TRACE) && | ||
320 | tracehook_report_syscall_entry(current_pt_regs())) | ||
321 | ret = -1UL; | ||
322 | return ret ?: current_pt_regs()->r0; | ||
323 | } | ||
324 | |||
315 | asmlinkage void | 325 | asmlinkage void |
316 | syscall_trace(void) | 326 | syscall_trace_leave(void) |
317 | { | 327 | { |
318 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | 328 | if (test_thread_flag(TIF_SYSCALL_TRACE)) |
319 | return; | 329 | tracehook_report_syscall_exit(current_pt_regs(), 0); |
320 | if (!(current->ptrace & PT_PTRACED)) | ||
321 | return; | ||
322 | /* The 0x80 provides a way for the tracing parent to distinguish | ||
323 | between a syscall stop and SIGTRAP delivery */ | ||
324 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) | ||
325 | ? 0x80 : 0)); | ||
326 | |||
327 | /* | ||
328 | * This isn't the same as continuing with a signal, but it will do | ||
329 | * for normal use. strace only continues with a signal if the | ||
330 | * stopping signal is not SIGTRAP. -brl | ||
331 | */ | ||
332 | if (current->exit_code) { | ||
333 | send_sig(current->exit_code, current, 1); | ||
334 | current->exit_code = 0; | ||
335 | } | ||
336 | } | 330 | } |