powerpc/kgdb: Bail out of KGDB when we've been triggered
authorTiejun Chen <tiejun.chen@windriver.com>
Wed, 22 Aug 2012 16:10:19 +0000 (16:10 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 24 Aug 2012 10:26:05 +0000 (20:26 +1000)
We need to skip a breakpoint exception when it occurs after
a breakpoint has already been removed.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/kgdb.c

index bbabc5abb1c43d62dd2a69760511dcefd66c5ad5..05adb69febf45a49262a7610a72a182bb5b4ed8d 100644 (file)
@@ -101,6 +101,21 @@ static int computeSignal(unsigned int tt)
        return SIGHUP;          /* default for things we don't know about */
 }
 
+/**
+ *
+ *     kgdb_skipexception - Bail out of KGDB when we've been triggered.
+ *     @exception: Exception vector number
+ *     @regs: Current &struct pt_regs.
+ *
+ *     On some architectures we need to skip a breakpoint exception when
+ *     it occurs after a breakpoint has been removed.
+ *
+ */
+int kgdb_skipexception(int exception, struct pt_regs *regs)
+{
+       return kgdb_isremovedbreak(regs->nip);
+}
+
 static int kgdb_call_nmi_hook(struct pt_regs *regs)
 {
        kgdb_nmicallback(raw_smp_processor_id(), regs);