Skip to content

Commit

Permalink
Merge branch 'sh/for-2.6.33' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/lethal/sh-2.6

* 'sh/for-2.6.33' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh64: fix tracing of signals.
  • Loading branch information
torvalds committed Feb 16, 2010
2 parents 627a9a1 + 4b505db commit e04984c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 9 additions & 2 deletions arch/sh/kernel/ptrace_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,17 @@ void user_enable_single_step(struct task_struct *child)
struct pt_regs *regs = child->thread.uregs;

regs->sr |= SR_SSTEP; /* auto-resetting upon exception */

set_tsk_thread_flag(child, TIF_SINGLESTEP);
}

void user_disable_single_step(struct task_struct *child)
{
struct pt_regs *regs = child->thread.uregs;

regs->sr &= ~SR_SSTEP;

clear_tsk_thread_flag(child, TIF_SINGLESTEP);
}

static int genregs_get(struct task_struct *target,
Expand Down Expand Up @@ -454,15 +458,18 @@ asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs)

asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
{
int step;

if (unlikely(current->audit_context))
audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]),
regs->regs[9]);

if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
trace_sys_exit(regs, regs->regs[9]);

if (test_thread_flag(TIF_SYSCALL_TRACE))
tracehook_report_syscall_exit(regs, 0);
step = test_thread_flag(TIF_SINGLESTEP);
if (step || test_thread_flag(TIF_SYSCALL_TRACE))
tracehook_report_syscall_exit(regs, step);
}

/* Called with interrupts disabled */
Expand Down
4 changes: 3 additions & 1 deletion arch/sh/kernel/signal_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ static int do_signal(struct pt_regs *regs, sigset_t *oldset)
* clear the TS_RESTORE_SIGMASK flag.
*/
current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
tracehook_signal_handler(signr, &info, &ka, regs, 0);

tracehook_signal_handler(signr, &info, &ka, regs,
test_thread_flag(TIF_SINGLESTEP));
return 1;
}
}
Expand Down

0 comments on commit e04984c

Please sign in to comment.