aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-07-25 22:45:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 15:00:09 -0400
commitc45aea27617d6a1e0aacddc3b0233f704222fcbd (patch)
tree9406cbb5f3ca0029b2f6ef44a951fb7d21fe93f9 /include/linux
parentfa8e26ccd485216fc45c8c2dd1ec3b7ef1a0a2f8 (diff)
tracehook: tracehook_signal_handler
This defines tracehook_signal_handler() as a hook for the arch signal handling code to call. It gives ptrace the opportunity to stop for a pseudo-single-step trap immediately after signal handler setup is done. Signed-off-by: Roland McGrath <roland@redhat.com> Cc: Oleg Nesterov <oleg@tv-sign.ru> Reviewed-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/tracehook.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index e113e09b0341..2d1426f8e33b 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -289,4 +289,27 @@ static inline void tracehook_finish_release_task(struct task_struct *task)
289 ptrace_release_task(task); 289 ptrace_release_task(task);
290} 290}
291 291
292/**
293 * tracehook_signal_handler - signal handler setup is complete
294 * @sig: number of signal being delivered
295 * @info: siginfo_t of signal being delivered
296 * @ka: sigaction setting that chose the handler
297 * @regs: user register state
298 * @stepping: nonzero if debugger single-step or block-step in use
299 *
300 * Called by the arch code after a signal handler has been set up.
301 * Register and stack state reflects the user handler about to run.
302 * Signal mask changes have already been made.
303 *
304 * Called without locks, shortly before returning to user mode
305 * (or handling more signals).
306 */
307static inline void tracehook_signal_handler(int sig, siginfo_t *info,
308 const struct k_sigaction *ka,
309 struct pt_regs *regs, int stepping)
310{
311 if (stepping)
312 ptrace_notify(SIGTRAP);
313}
314
292#endif /* <linux/tracehook.h> */ 315#endif /* <linux/tracehook.h> */