Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79884
b: refs/heads/master
c: 5b88abb
h: refs/heads/master
v: v3
  • Loading branch information
Roland McGrath authored and Ingo Molnar committed Jan 30, 2008
1 parent 2725c14 commit 935b7c2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dc802c2d2e66e2d1544e023bfd4be6cdee48d57b
refs/heads/master: 5b88abbf770a0e1975c668743100f42934f385e8
2 changes: 1 addition & 1 deletion trunk/include/linux/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static inline void user_disable_single_step(struct task_struct *task)
* supports step-until-branch for user mode. It can be a constant or it
* can test a CPU feature bit.
*/
#define arch_has_single_step() (0)
#define arch_has_block_step() (0)

/**
* user_enable_block_step - step until branch in user-mode task
Expand Down
15 changes: 14 additions & 1 deletion trunk/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,12 @@ static int ptrace_setsiginfo(struct task_struct *child, siginfo_t __user * data)
#define is_singlestep(request) 0
#endif

#ifdef PTRACE_SINGLEBLOCK
#define is_singleblock(request) ((request) == PTRACE_SINGLEBLOCK)
#else
#define is_singleblock(request) 0
#endif

#ifdef PTRACE_SYSEMU
#define is_sysemu_singlestep(request) ((request) == PTRACE_SYSEMU_SINGLESTEP)
#else
Expand All @@ -396,7 +402,11 @@ static int ptrace_resume(struct task_struct *child, long request, long data)
clear_tsk_thread_flag(child, TIF_SYSCALL_EMU);
#endif

if (is_singlestep(request) || is_sysemu_singlestep(request)) {
if (is_singleblock(request)) {
if (unlikely(!arch_has_block_step()))
return -EIO;
user_enable_block_step(child);
} else if (is_singlestep(request) || is_sysemu_singlestep(request)) {
if (unlikely(!arch_has_single_step()))
return -EIO;
user_enable_single_step(child);
Expand Down Expand Up @@ -438,6 +448,9 @@ int ptrace_request(struct task_struct *child, long request,
#ifdef PTRACE_SINGLESTEP
case PTRACE_SINGLESTEP:
#endif
#ifdef PTRACE_SINGLEBLOCK
case PTRACE_SINGLEBLOCK:
#endif
#ifdef PTRACE_SYSEMU
case PTRACE_SYSEMU:
case PTRACE_SYSEMU_SINGLESTEP:
Expand Down

0 comments on commit 935b7c2

Please sign in to comment.