[PATCH 10/23] tracehook: tracehook_signal_handler

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Roland McGrath
Date: Thursday, July 17, 2008 - 12:30 am

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>
---
 include/linux/tracehook.h |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index e113e09..2d1426f 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)
 	ptrace_release_task(task);
 }
 
+/**
+ * tracehook_signal_handler - signal handler setup is complete
+ * @sig:		number of signal being delivered
+ * @info:		siginfo_t of signal being delivered
+ * @ka:			sigaction setting that chose the handler
+ * @regs:		user register state
+ * @stepping:		nonzero if debugger single-step or block-step in use
+ *
+ * Called by the arch code after a signal handler has been set up.
+ * Register and stack state reflects the user handler about to run.
+ * Signal mask changes have already been made.
+ *
+ * Called without locks, shortly before returning to user mode
+ * (or handling more signals).
+ */
+static inline void tracehook_signal_handler(int sig, siginfo_t *info,
+					    const struct k_sigaction *ka,
+					    struct pt_regs *regs, int stepping)
+{
+	if (stepping)
+		ptrace_notify(SIGTRAP);
+}
+
 #endif	/* <linux/tracehook.h> */
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/23] tracehook, Roland McGrath, (Thu Jul 17, 12:25 am)
[PATCH 01/23] tracehook: add linux/tracehook.h, Roland McGrath, (Thu Jul 17, 12:27 am)
[PATCH 02/23] tracehook: exec, Roland McGrath, (Thu Jul 17, 12:28 am)
[PATCH 03/23] tracehook: unexport ptrace_notify, Roland McGrath, (Thu Jul 17, 12:28 am)
[PATCH 04/23] tracehook: exit, Roland McGrath, (Thu Jul 17, 12:28 am)
[PATCH 05/23] tracehook: clone, Roland McGrath, (Thu Jul 17, 12:29 am)
[PATCH 06/23] tracehook: vfork-done, Roland McGrath, (Thu Jul 17, 12:29 am)
[PATCH 07/23] tracehook: release_task, Roland McGrath, (Thu Jul 17, 12:29 am)
[PATCH 08/23] tracehook: tracehook_tracer_task, Roland McGrath, (Thu Jul 17, 12:29 am)
[PATCH 09/23] tracehook: tracehook_expect_breakpoints, Roland McGrath, (Thu Jul 17, 12:29 am)
[PATCH 10/23] tracehook: tracehook_signal_handler, Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 11/23] tracehook: tracehook_consider_ignored_signal, Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 12/23] tracehook: tracehook_consider_fatal_signal, Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 13/23] tracehook: syscall, Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 14/23] tracehook: get_signal_to_deliver, Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 15/23] tracehook: job control, Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 16/23] tracehook: death, Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 17/23] tracehook: force signal_pending(), Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 18/23] tracehook: TIF_NOTIFY_RESUME, Roland McGrath, (Thu Jul 17, 12:31 am)
[PATCH 19/23] tracehook: asm/syscall.h, Roland McGrath, (Thu Jul 17, 12:31 am)
[PATCH 20/23] tracehook: CONFIG_HAVE_ARCH_TRACEHOOK, Roland McGrath, (Thu Jul 17, 12:31 am)
[PATCH 21/23] tracehook: wait_task_inactive, Roland McGrath, (Thu Jul 17, 12:31 am)
[PATCH 22/23] task_current_syscall, Roland McGrath, (Thu Jul 17, 12:31 am)
[PATCH 23/23] /proc/PID/syscall, Roland McGrath, (Thu Jul 17, 12:31 am)
Re: [PATCH 00/23] tracehook, Andrew Morton, (Thu Jul 17, 12:39 am)
Re: [PATCH 00/23] tracehook, Roland McGrath, (Thu Jul 17, 1:11 am)
Re: [PATCH 00/23] tracehook, Andrew Morton, (Thu Jul 17, 1:30 am)
Re: [PATCH 00/23] tracehook, Roland McGrath, (Thu Jul 17, 1:37 am)
Re: [PATCH 01/23] tracehook: add linux/tracehook.h, Alexey Dobriyan, (Thu Jul 17, 1:48 am)
Re: [PATCH 00/23] tracehook, Andrew Morton, (Thu Jul 17, 1:51 am)
Re: [PATCH 01/23] tracehook: add linux/tracehook.h, Petr Tesarik, (Thu Jul 17, 4:06 am)
Re: [PATCH 01/23] tracehook: add linux/tracehook.h, Christoph Hellwig, (Thu Jul 17, 6:34 am)
Re: [PATCH 01/23] tracehook: add linux/tracehook.h, Alexey Dobriyan, (Thu Jul 17, 2:50 pm)
Re: [PATCH 23/23] /proc/PID/syscall, Alexey Dobriyan, (Thu Jul 17, 3:56 pm)
Re: [PATCH 00/23] tracehook, Ingo Molnar, (Fri Jul 18, 1:07 am)
Re: [PATCH 00/23] tracehook, David Miller, (Fri Jul 18, 2:20 am)
Re: [PATCH 00/23] tracehook, Andi Kleen, (Fri Jul 18, 4:24 am)
Re: [PATCH 00/23] tracehook, David Miller, (Fri Jul 18, 4:32 am)
Re: [PATCH 01/23] tracehook: add linux/tracehook.h, Petr Tesarik, (Fri Jul 18, 4:57 am)
Re: [PATCH 23/23] /proc/PID/syscall, Roland McGrath, (Mon Jul 21, 1:19 am)
Re: [PATCH 02/23] tracehook: exec, Christoph Hellwig, (Mon Jul 21, 1:49 am)
Re: [PATCH 00/23] tracehook, Roland McGrath, (Mon Jul 21, 2:59 am)
Re: [PATCH 00/23] tracehook, Roland McGrath, (Mon Jul 21, 3:54 am)
Re: [PATCH 00/23] tracehook, David Miller, (Mon Jul 21, 8:18 am)