diff options
Diffstat (limited to 'arch/parisc/kernel/ptrace.c')
| -rw-r--r-- | arch/parisc/kernel/ptrace.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c index 927db3668b6f..c4f49e45129d 100644 --- a/arch/parisc/kernel/ptrace.c +++ b/arch/parisc/kernel/ptrace.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/smp.h> | 13 | #include <linux/smp.h> |
| 14 | #include <linux/errno.h> | 14 | #include <linux/errno.h> |
| 15 | #include <linux/ptrace.h> | 15 | #include <linux/ptrace.h> |
| 16 | #include <linux/tracehook.h> | ||
| 16 | #include <linux/user.h> | 17 | #include <linux/user.h> |
| 17 | #include <linux/personality.h> | 18 | #include <linux/personality.h> |
| 18 | #include <linux/security.h> | 19 | #include <linux/security.h> |
| @@ -35,7 +36,8 @@ | |||
| 35 | */ | 36 | */ |
| 36 | void ptrace_disable(struct task_struct *task) | 37 | void ptrace_disable(struct task_struct *task) |
| 37 | { | 38 | { |
| 38 | task->ptrace &= ~(PT_SINGLESTEP|PT_BLOCKSTEP); | 39 | clear_tsk_thread_flag(task, TIF_SINGLESTEP); |
| 40 | clear_tsk_thread_flag(task, TIF_BLOCKSTEP); | ||
| 39 | 41 | ||
| 40 | /* make sure the trap bits are not set */ | 42 | /* make sure the trap bits are not set */ |
| 41 | pa_psw(task)->r = 0; | 43 | pa_psw(task)->r = 0; |
| @@ -55,8 +57,8 @@ void user_disable_single_step(struct task_struct *task) | |||
| 55 | 57 | ||
| 56 | void user_enable_single_step(struct task_struct *task) | 58 | void user_enable_single_step(struct task_struct *task) |
| 57 | { | 59 | { |
| 58 | task->ptrace &= ~PT_BLOCKSTEP; | 60 | clear_tsk_thread_flag(task, TIF_BLOCKSTEP); |
| 59 | task->ptrace |= PT_SINGLESTEP; | 61 | set_tsk_thread_flag(task, TIF_SINGLESTEP); |
| 60 | 62 | ||
| 61 | if (pa_psw(task)->n) { | 63 | if (pa_psw(task)->n) { |
| 62 | struct siginfo si; | 64 | struct siginfo si; |
| @@ -98,8 +100,8 @@ void user_enable_single_step(struct task_struct *task) | |||
| 98 | 100 | ||
| 99 | void user_enable_block_step(struct task_struct *task) | 101 | void user_enable_block_step(struct task_struct *task) |
| 100 | { | 102 | { |
| 101 | task->ptrace &= ~PT_SINGLESTEP; | 103 | clear_tsk_thread_flag(task, TIF_SINGLESTEP); |
| 102 | task->ptrace |= PT_BLOCKSTEP; | 104 | set_tsk_thread_flag(task, TIF_BLOCKSTEP); |
| 103 | 105 | ||
| 104 | /* Enable taken branch trap. */ | 106 | /* Enable taken branch trap. */ |
| 105 | pa_psw(task)->r = 0; | 107 | pa_psw(task)->r = 0; |
| @@ -263,22 +265,20 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
| 263 | } | 265 | } |
| 264 | #endif | 266 | #endif |
| 265 | 267 | ||
| 268 | long do_syscall_trace_enter(struct pt_regs *regs) | ||
| 269 | { | ||
| 270 | if (test_thread_flag(TIF_SYSCALL_TRACE) && | ||
| 271 | tracehook_report_syscall_entry(regs)) | ||
| 272 | return -1L; | ||
| 273 | |||
| 274 | return regs->gr[20]; | ||
| 275 | } | ||
| 266 | 276 | ||
| 267 | void syscall_trace(void) | 277 | void do_syscall_trace_exit(struct pt_regs *regs) |
| 268 | { | 278 | { |
| 269 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | 279 | int stepping = test_thread_flag(TIF_SINGLESTEP) || |
| 270 | return; | 280 | test_thread_flag(TIF_BLOCKSTEP); |
| 271 | if (!(current->ptrace & PT_PTRACED)) | 281 | |
| 272 | return; | 282 | if (stepping || test_thread_flag(TIF_SYSCALL_TRACE)) |
| 273 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) | 283 | tracehook_report_syscall_exit(regs, stepping); |
| 274 | ? 0x80 : 0)); | ||
| 275 | /* | ||
| 276 | * this isn't the same as continuing with a signal, but it will do | ||
| 277 | * for normal use. strace only continues with a signal if the | ||
| 278 | * stopping signal is not SIGTRAP. -brl | ||
| 279 | */ | ||
| 280 | if (current->exit_code) { | ||
| 281 | send_sig(current->exit_code, current, 1); | ||
| 282 | current->exit_code = 0; | ||
| 283 | } | ||
| 284 | } | 284 | } |
