Re: Trap flag handling change in 2.6.10-bk5 broke Kylix debugger

From: Chuck Ebbert
Date: Tue Feb 14 2006 - 22:22:28 EST


In-Reply-To: <43F23BB4.8070703@xxxxxxxxxxxx>

On Tue, 14 Feb 2006 at 20:21:08 +0000, Paulo Marques wrote:

> Going even further, a 2.6.10-bk5 kernel without this single change runs
> the debugger just fine:
>
> > @@ -718,23 +717,21 @@
> > */
> > if ((regs->xcs & 3) == 0)
> > goto clear_TF_reenable;
> > - if ((tsk->ptrace & (PT_DTRACE|PT_PTRACED)) == PT_DTRACE)
> > - goto clear_TF;
> > +
> > + /*
> > + * Was the TF flag set by a debugger? If so, clear it now,
> > + * so that register information is correct.
> > + */
> > + if (tsk->ptrace & PT_DTRACE) {
> > + regs->eflags &= ~TF_MASK;
> > + tsk->ptrace &= ~PT_DTRACE;
> > + if (!tsk->ptrace & PT_DTRACE)
^^^^^^^^^^^^^^^^^^^^^^^^
Looks like this is always true because that bit was cleared one line above.
Maybe it should be testing PT_DTRACED instead? And it's missing parens too,
so try:
if (!(tsk->ptrace & PT_DTRACED))


> > + goto clear_TF;
> > + }
> > }
> >
> > /* Ok, finally something we can handle */

--
Chuck
"Equations are the Devil's sentences." --Stephen Colbert
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/