"Spurious" trace flags and debug traps

Bernd Paysan (bernd.paysan@gmx.de)
Sun, 30 Aug 1998 14:44:21 +0200 (MET DST)


Hi!

I just realized that the kernel now clears "spurious" trace flags and
DR7 settings (patch from 2.1.113). Please back these changes out. They
break my program (bigFORTH), which is an interactive language that can
trace itself (and it must trace itself - ptracing by a parent process is
not an option, since it's much more complicated to get to the "symbol"
informations, and well, I presume it's slower, too).

I see no obvious reason why a program should not be able to debug itself.
Wine does so, too (it uses int3 to set breakpoints, and therefore works
even with the current kernel).

Bernd Paysan
"Late answers are wrong answers!"
http://www.jwdt.com/~paysan/

--- linux/arch/i386/kernel/traps.c.orig Sun Aug 23 13:49:35 1998
+++ linux/arch/i386/kernel/traps.c Sun Aug 30 14:27:46 1998
@@ -327,6 +327,7 @@
if (regs->eflags & VM_MASK)
goto debug_vm86;

+#ifdef CLEAR_SPURIOUS_TF
__asm__ __volatile__("movl %%db6,%0" : "=r" (condition));

/* Mask out spurious TF errors due to lazy TF clearing */
@@ -340,6 +341,7 @@
if (!tsk->tss.debugreg[7])
goto clear_dr7;
}
+#endif

/* If this is a kernel mode trap, we need to reset db7 to allow us to continue sanely */
if ((regs->xcs & 3) == 0)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html