
From: "Andi Kleen" <ak@suse.de>

Allow a kernel debugger to hide single steps in more cases.

Apparently helps the kgdb people.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/x86_64/kernel/traps.c  |    4 +++-
 25-akpm/include/asm-x86_64/kdebug.h |    1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff -puN arch/x86_64/kernel/traps.c~x86_64-allow-a-kernel-debugger-to-hide-single-steps-in arch/x86_64/kernel/traps.c
--- 25/arch/x86_64/kernel/traps.c~x86_64-allow-a-kernel-debugger-to-hide-single-steps-in	2004-11-28 01:54:37.113954928 -0800
+++ 25-akpm/arch/x86_64/kernel/traps.c	2004-11-28 01:54:37.118954168 -0800
@@ -691,7 +691,9 @@ asmlinkage void *do_debug(struct pt_regs
 	tsk->thread.debugreg6 = condition;
 
 	/* Mask out spurious TF errors due to lazy TF clearing */
-	if (condition & DR_STEP) {
+	if ((condition & DR_STEP) &&
+	    (notify_die(DIE_DEBUGSTEP, "debugstep", regs, condition,
+			1, SIGTRAP) != NOTIFY_STOP)) {
 		/*
 		 * The TF error should be masked out only if the current
 		 * process is not traced and if the TRAP flag has been set
diff -puN include/asm-x86_64/kdebug.h~x86_64-allow-a-kernel-debugger-to-hide-single-steps-in include/asm-x86_64/kdebug.h
--- 25/include/asm-x86_64/kdebug.h~x86_64-allow-a-kernel-debugger-to-hide-single-steps-in	2004-11-28 01:54:37.114954776 -0800
+++ 25-akpm/include/asm-x86_64/kdebug.h	2004-11-28 01:54:37.118954168 -0800
@@ -23,6 +23,7 @@ enum die_val { 
 	DIE_OOPS = 1,
 	DIE_INT3,
 	DIE_DEBUG,
+	DIE_DEBUGSTEP,
 	DIE_PANIC,
 	DIE_NMI,
 	DIE_DIE,
_
