tree 1ce31b822346bb65864813d774a67037c7d3b684
parent b957591fee753101f289615abab1c54ff7b1d29d
author Andi Kleen <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:25:00 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:25:00 -0700

[PATCH] x86_64: Fix interaction of single stepping with debuggers

Ported from i386/Linus

Fix another TF corner case.  Need to do the special TF handling for all
signals to make debuggers happy

Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 x86_64/kernel/signal.c |   12 ++++++++++++
 1 files changed, 12 insertions(+)

Index: arch/x86_64/kernel/signal.c
===================================================================
--- 369eccf7e24a263627977dd7a0986e779449c30d/arch/x86_64/kernel/signal.c  
(mode:100644 sha1:4ff0f0117a091c991d63860cc2aae31184311e47)
+++ 1ce31b822346bb65864813d774a67037c7d3b684/arch/x86_64/kernel/signal.c  
(mode:100644 sha1:7760224cdfe39af70467cb2f8e28153389f979aa)
@@ -368,6 +368,18 @@
                }
        }
 
+       /*
+        * 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)) {
+               if (likely(current->ptrace & PT_DTRACE)) {
+                       current->ptrace &= ~PT_DTRACE;
+                       regs->eflags &= ~TF_MASK;
+               }
+       }
+
 #ifdef CONFIG_IA32_EMULATION
        if (test_thread_flag(TIF_IA32)) {
                if (ka->sa.sa_flags & SA_SIGINFO)
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to