diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2007-03-04 04:50:28 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-04-21 15:34:58 -0400 |
commit | b2a0d36fde90fa9dd20b7dde21dbcff09b130b38 (patch) | |
tree | 354fe85244f011e17e1c96243f5f7925ba16b6b6 /arch/arm/kernel/ptrace.h | |
parent | 0f0a00beb80624a446ba7c0152cd171008eeab2e (diff) |
[ARM] ptrace: clean up single stepping support
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/ptrace.h')
-rw-r--r-- | arch/arm/kernel/ptrace.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm/kernel/ptrace.h b/arch/arm/kernel/ptrace.h index f7cad13a22e9..def3b6184a79 100644 --- a/arch/arm/kernel/ptrace.h +++ b/arch/arm/kernel/ptrace.h | |||
@@ -7,6 +7,45 @@ | |||
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #include <linux/ptrace.h> | ||
11 | |||
10 | extern void ptrace_cancel_bpt(struct task_struct *); | 12 | extern void ptrace_cancel_bpt(struct task_struct *); |
11 | extern void ptrace_set_bpt(struct task_struct *); | 13 | extern void ptrace_set_bpt(struct task_struct *); |
12 | extern void ptrace_break(struct task_struct *, struct pt_regs *); | 14 | extern void ptrace_break(struct task_struct *, struct pt_regs *); |
15 | |||
16 | /* | ||
17 | * make sure single-step breakpoint is gone. | ||
18 | */ | ||
19 | static inline void single_step_disable(struct task_struct *task) | ||
20 | { | ||
21 | task->ptrace &= ~PT_SINGLESTEP; | ||
22 | ptrace_cancel_bpt(task); | ||
23 | } | ||
24 | |||
25 | static inline void single_step_enable(struct task_struct *task) | ||
26 | { | ||
27 | task->ptrace |= PT_SINGLESTEP; | ||
28 | } | ||
29 | |||
30 | /* | ||
31 | * Send SIGTRAP if we're single-stepping | ||
32 | */ | ||
33 | static inline void single_step_trap(struct task_struct *task) | ||
34 | { | ||
35 | if (task->ptrace & PT_SINGLESTEP) { | ||
36 | ptrace_cancel_bpt(task); | ||
37 | send_sig(SIGTRAP, task, 1); | ||
38 | } | ||
39 | } | ||
40 | |||
41 | static inline void single_step_clear(struct task_struct *task) | ||
42 | { | ||
43 | if (task->ptrace & PT_SINGLESTEP) | ||
44 | ptrace_cancel_bpt(task); | ||
45 | } | ||
46 | |||
47 | static inline void single_step_set(struct task_struct *task) | ||
48 | { | ||
49 | if (task->ptrace & PT_SINGLESTEP) | ||
50 | ptrace_set_bpt(task); | ||
51 | } | ||