diff options
author | Oleg Nesterov <oleg@redhat.com> | 2009-12-15 16:47:17 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 07:20:08 -0800 |
commit | 85ec7fd9f8e528c4f61d595cfe4df7681a19f252 (patch) | |
tree | 67c81a68f3302f02b6f769b9acede7efeb5edc8e /include/linux/ptrace.h | |
parent | 6580807da14c423f0d0a708108e6df6ebc8bc83d (diff) | |
download | linux-85ec7fd9f8e528c4f61d595cfe4df7681a19f252.tar.gz linux-85ec7fd9f8e528c4f61d595cfe4df7681a19f252.tar.bz2 linux-85ec7fd9f8e528c4f61d595cfe4df7681a19f252.zip |
ptrace: introduce user_single_step_siginfo() helper
Suggested by Roland.
Currently there is no way to synthesize a single-stepping trap in the
arch-independent manner. This patch adds the default helper which fills
siginfo_t, arch/ can can override it.
Architetures which implement user_enable_single_step() should add
user_single_step_siginfo() also.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Roland McGrath <roland@redhat.com>
Cc: <linux-arch@vger.kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/ptrace.h')
-rw-r--r-- | include/linux/ptrace.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 1951805df63a..56f2d63a5cbb 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -273,6 +273,18 @@ static inline void user_enable_block_step(struct task_struct *task) } #endif /* arch_has_block_step */ +#ifdef ARCH_HAS_USER_SINGLE_STEP_INFO +extern void user_single_step_siginfo(struct task_struct *tsk, + struct pt_regs *regs, siginfo_t *info); +#else +static inline void user_single_step_siginfo(struct task_struct *tsk, + struct pt_regs *regs, siginfo_t *info) +{ + memset(info, 0, sizeof(*info)); + info->si_signo = SIGTRAP; +} +#endif + #ifndef arch_ptrace_stop_needed /** * arch_ptrace_stop_needed - Decide whether arch_ptrace_stop() should be called |