diff options
Diffstat (limited to 'arch/xtensa/kernel')
-rw-r--r-- | arch/xtensa/kernel/ptrace.c | 56 |
1 files changed, 11 insertions, 45 deletions
diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c index 9486882ef0af..9d4e1ceb3f09 100644 --- a/arch/xtensa/kernel/ptrace.c +++ b/arch/xtensa/kernel/ptrace.c | |||
@@ -30,6 +30,17 @@ | |||
30 | #include <asm/elf.h> | 30 | #include <asm/elf.h> |
31 | #include <asm/coprocessor.h> | 31 | #include <asm/coprocessor.h> |
32 | 32 | ||
33 | |||
34 | void user_enable_single_step(struct task_struct *child) | ||
35 | { | ||
36 | child->ptrace |= PT_SINGLESTEP; | ||
37 | } | ||
38 | |||
39 | void user_disable_single_step(struct task_struct *child) | ||
40 | { | ||
41 | child->ptrace &= ~PT_SINGLESTEP; | ||
42 | } | ||
43 | |||
33 | /* | 44 | /* |
34 | * Called by kernel/ptrace.c when detaching to disable single stepping. | 45 | * Called by kernel/ptrace.c when detaching to disable single stepping. |
35 | */ | 46 | */ |
@@ -268,51 +279,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
268 | ret = ptrace_pokeusr(child, addr, data); | 279 | ret = ptrace_pokeusr(child, addr, data); |
269 | break; | 280 | break; |
270 | 281 | ||
271 | /* continue and stop at next (return from) syscall */ | ||
272 | |||
273 | case PTRACE_SYSCALL: | ||
274 | case PTRACE_CONT: /* restart after signal. */ | ||
275 | { | ||
276 | ret = -EIO; | ||
277 | if (!valid_signal(data)) | ||
278 | break; | ||
279 | if (request == PTRACE_SYSCALL) | ||
280 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
281 | else | ||
282 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
283 | child->exit_code = data; | ||
284 | /* Make sure the single step bit is not set. */ | ||
285 | child->ptrace &= ~PT_SINGLESTEP; | ||
286 | wake_up_process(child); | ||
287 | ret = 0; | ||
288 | break; | ||
289 | } | ||
290 | |||
291 | /* | ||
292 | * make the child exit. Best I can do is send it a sigkill. | ||
293 | * perhaps it should be put in the status that it wants to | ||
294 | * exit. | ||
295 | */ | ||
296 | case PTRACE_KILL: | ||
297 | ret = 0; | ||
298 | if (child->exit_state == EXIT_ZOMBIE) /* already dead */ | ||
299 | break; | ||
300 | child->exit_code = SIGKILL; | ||
301 | child->ptrace &= ~PT_SINGLESTEP; | ||
302 | wake_up_process(child); | ||
303 | break; | ||
304 | |||
305 | case PTRACE_SINGLESTEP: | ||
306 | ret = -EIO; | ||
307 | if (!valid_signal(data)) | ||
308 | break; | ||
309 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
310 | child->ptrace |= PT_SINGLESTEP; | ||
311 | child->exit_code = data; | ||
312 | wake_up_process(child); | ||
313 | ret = 0; | ||
314 | break; | ||
315 | |||
316 | case PTRACE_GETREGS: | 282 | case PTRACE_GETREGS: |
317 | ret = ptrace_getregs(child, (void __user *) data); | 283 | ret = ptrace_getregs(child, (void __user *) data); |
318 | break; | 284 | break; |