aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/ptrace.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-01-30 07:30:53 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:30:53 -0500
commit5b88abbf770a0e1975c668743100f42934f385e8 (patch)
treeae6af4df76e71682efb4d90620182bfaf541e9c8 /kernel/ptrace.c
parentdc802c2d2e66e2d1544e023bfd4be6cdee48d57b (diff)
ptrace: generic PTRACE_SINGLEBLOCK
This makes ptrace_request handle PTRACE_SINGLEBLOCK along with PTRACE_CONT et al. The new generic code makes use of the arch_has_block_step macro and generic entry points on machines that define them. [ mingo@elte.hu: bugfix ] Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/ptrace.c')
-rw-r--r--kernel/ptrace.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index fad5f1e8511f..973d727f5e84 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -373,6 +373,12 @@ static int ptrace_setsiginfo(struct task_struct *child, siginfo_t __user * data)
373#define is_singlestep(request) 0 373#define is_singlestep(request) 0
374#endif 374#endif
375 375
376#ifdef PTRACE_SINGLEBLOCK
377#define is_singleblock(request) ((request) == PTRACE_SINGLEBLOCK)
378#else
379#define is_singleblock(request) 0
380#endif
381
376#ifdef PTRACE_SYSEMU 382#ifdef PTRACE_SYSEMU
377#define is_sysemu_singlestep(request) ((request) == PTRACE_SYSEMU_SINGLESTEP) 383#define is_sysemu_singlestep(request) ((request) == PTRACE_SYSEMU_SINGLESTEP)
378#else 384#else
@@ -396,7 +402,11 @@ static int ptrace_resume(struct task_struct *child, long request, long data)
396 clear_tsk_thread_flag(child, TIF_SYSCALL_EMU); 402 clear_tsk_thread_flag(child, TIF_SYSCALL_EMU);
397#endif 403#endif
398 404
399 if (is_singlestep(request) || is_sysemu_singlestep(request)) { 405 if (is_singleblock(request)) {
406 if (unlikely(!arch_has_block_step()))
407 return -EIO;
408 user_enable_block_step(child);
409 } else if (is_singlestep(request) || is_sysemu_singlestep(request)) {
400 if (unlikely(!arch_has_single_step())) 410 if (unlikely(!arch_has_single_step()))
401 return -EIO; 411 return -EIO;
402 user_enable_single_step(child); 412 user_enable_single_step(child);
@@ -438,6 +448,9 @@ int ptrace_request(struct task_struct *child, long request,
438#ifdef PTRACE_SINGLESTEP 448#ifdef PTRACE_SINGLESTEP
439 case PTRACE_SINGLESTEP: 449 case PTRACE_SINGLESTEP:
440#endif 450#endif
451#ifdef PTRACE_SINGLEBLOCK
452 case PTRACE_SINGLEBLOCK:
453#endif
441#ifdef PTRACE_SYSEMU 454#ifdef PTRACE_SYSEMU
442 case PTRACE_SYSEMU: 455 case PTRACE_SYSEMU:
443 case PTRACE_SYSEMU_SINGLESTEP: 456 case PTRACE_SYSEMU_SINGLESTEP: