X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fi386%2Fkernel%2Fsignal.c;h=43002cfb40c4e2811bf5006c9126fa2ff1cfdd46;hb=e0ff8aa1acd079b70e796571917ae0449b7c465b;hp=0f187c95f5ed20d7f8184557644077d221dddd4c;hpb=bef9ea3086d47cf98cfd0ea389953a0af0b60114;p=linux-2.6.git diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c index 0f187c95f..43002cfb4 100644 --- a/arch/i386/kernel/signal.c +++ b/arch/i386/kernel/signal.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -385,6 +385,16 @@ static int setup_frame(int sig, struct k_sigaction *ka, regs->xss = __USER_DS; regs->xcs = __USER_CS; + /* + * Clear TF when entering the signal handler, but + * notify any tracer that was single-stepping it. + * The tracer may want to single-step inside the + * handler too. + */ + regs->eflags &= ~TF_MASK; + if (test_thread_flag(TIF_SINGLESTEP)) + ptrace_notify(SIGTRAP); + #if DEBUG_SIG printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", current->comm, current->pid, frame, regs->eip, frame->pretcode); @@ -469,6 +479,16 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, regs->xss = __USER_DS; regs->xcs = __USER_CS; + /* + * Clear TF when entering the signal handler, but + * notify any tracer that was single-stepping it. + * The tracer may want to single-step inside the + * handler too. + */ + regs->eflags &= ~TF_MASK; + if (test_thread_flag(TIF_SINGLESTEP)) + ptrace_notify(SIGTRAP); + #if DEBUG_SIG printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", current->comm, current->pid, frame, regs->eip, frame->pretcode); @@ -513,12 +533,14 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, } /* - * If TF is set due to a debugger (TIF_FORCED_TF), clear the TF flag so + * If TF is set due to a debugger (PT_DTRACE), clear the TF flag so * that register information in the sigcontext is correct. */ if (unlikely(regs->eflags & TF_MASK) - && likely(test_and_clear_thread_flag(TIF_FORCED_TF))) + && likely(current->ptrace & PT_DTRACE)) { + current->ptrace &= ~PT_DTRACE; regs->eflags &= ~TF_MASK; + } /* Set up the stack frame */ if (ka->sa.sa_flags & SA_SIGINFO) @@ -533,15 +555,6 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, sigaddset(¤t->blocked,sig); recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); - - /* - * Clear TF when entering the signal handler, but - * notify any tracer that was single-stepping it. - * The tracer may want to single-step inside the - * handler too. - */ - regs->eflags &= ~TF_MASK; - tracehook_report_handle_signal(sig, ka, oldset, regs); } return ret;