[PATCH] kdb/mdb hardware breakpoints broken 2.4.17/18

Jeff V. Merkey (jmerkey@vger.timpanogas.org)
Wed, 23 Jan 2002 14:00:45 -0700


--SLDf9lqlvOQaIe6s
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Please find a patch that corrects the problem with hardware
breakpoints not working with kdb. I have noticed that gdb uses
inserted int3 (0xCC) breakpoints (as does kdb) for soft breakpoint
support, so this fix may not affect these programs. It is not
clear why every signal handled is writing a 0 t the DR7 register.

Patch submitted to Keith Owens and Linux kernel.

Jeff

--SLDf9lqlvOQaIe6s
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="patch-0123.kdb"

diff -Naur ./arch/i386/kernel/signal.c ../linux-new/./arch/i386/kernel/signal.c
--- ./arch/i386/kernel/signal.c Fri Sep 14 15:15:40 2001
+++ ../linux-new/./arch/i386/kernel/signal.c Wed Jan 23 13:26:07 2002
@@ -698,7 +698,9 @@
* have been cleared if the watchpoint triggered
* inside the kernel.
*/
- __asm__("movl %0,%%db7" : : "r" (current->thread.debugreg[7]));
+
+ if (current->thread.debugreg[7])
+ __asm__("movl %0,%%db7" : : "r" (current->thread.debugreg[7]));

/* Whee! Actually deliver the signal. */
handle_signal(signr, ka, &info, oldset, regs);

--SLDf9lqlvOQaIe6s--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/