mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 13:44:15 +08:00
ptrace: Add @why to ptrace_stop()
To prepare for cleanup of the interaction between group stop and ptrace, add @why to ptrace_stop(). Existing users are updated such that there is no behavior change. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Roland McGrath <roland@redhat.com>
This commit is contained in:
parent
edf2ed153b
commit
fe1bc6a095
@ -1617,7 +1617,7 @@ static int sigkill_pending(struct task_struct *tsk)
|
|||||||
* If we actually decide not to stop at all because the tracer
|
* If we actually decide not to stop at all because the tracer
|
||||||
* is gone, we keep current->exit_code unless clear_code.
|
* is gone, we keep current->exit_code unless clear_code.
|
||||||
*/
|
*/
|
||||||
static void ptrace_stop(int exit_code, int clear_code, siginfo_t *info)
|
static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info)
|
||||||
__releases(¤t->sighand->siglock)
|
__releases(¤t->sighand->siglock)
|
||||||
__acquires(¤t->sighand->siglock)
|
__acquires(¤t->sighand->siglock)
|
||||||
{
|
{
|
||||||
@ -1655,7 +1655,7 @@ static void ptrace_stop(int exit_code, int clear_code, siginfo_t *info)
|
|||||||
spin_unlock_irq(¤t->sighand->siglock);
|
spin_unlock_irq(¤t->sighand->siglock);
|
||||||
read_lock(&tasklist_lock);
|
read_lock(&tasklist_lock);
|
||||||
if (may_ptrace_stop()) {
|
if (may_ptrace_stop()) {
|
||||||
do_notify_parent_cldstop(current, CLD_TRAPPED);
|
do_notify_parent_cldstop(current, why);
|
||||||
/*
|
/*
|
||||||
* Don't want to allow preemption here, because
|
* Don't want to allow preemption here, because
|
||||||
* sys_ptrace() needs this task to be inactive.
|
* sys_ptrace() needs this task to be inactive.
|
||||||
@ -1714,7 +1714,7 @@ void ptrace_notify(int exit_code)
|
|||||||
|
|
||||||
/* Let the debugger run. */
|
/* Let the debugger run. */
|
||||||
spin_lock_irq(¤t->sighand->siglock);
|
spin_lock_irq(¤t->sighand->siglock);
|
||||||
ptrace_stop(exit_code, 1, &info);
|
ptrace_stop(exit_code, CLD_TRAPPED, 1, &info);
|
||||||
spin_unlock_irq(¤t->sighand->siglock);
|
spin_unlock_irq(¤t->sighand->siglock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1795,7 +1795,7 @@ static int ptrace_signal(int signr, siginfo_t *info,
|
|||||||
ptrace_signal_deliver(regs, cookie);
|
ptrace_signal_deliver(regs, cookie);
|
||||||
|
|
||||||
/* Let the debugger run. */
|
/* Let the debugger run. */
|
||||||
ptrace_stop(signr, 0, info);
|
ptrace_stop(signr, CLD_TRAPPED, 0, info);
|
||||||
|
|
||||||
/* We're back. Did the debugger cancel the sig? */
|
/* We're back. Did the debugger cancel the sig? */
|
||||||
signr = current->exit_code;
|
signr = current->exit_code;
|
||||||
|
Loading…
Reference in New Issue
Block a user