kgdbts,sh: Add in breakpoint pc offset for superh
authorJason Wessel <jason.wessel@windriver.com>
Fri, 2 Apr 2010 16:31:35 +0000 (11:31 -0500)
committerJason Wessel <jason.wessel@windriver.com>
Fri, 2 Apr 2010 19:58:17 +0000 (14:58 -0500)
The kgdb test suite mimics the behavior of gdb.  For the sh
architecture the pc must be decremented by 2 for software breakpoint.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
drivers/misc/kgdbts.c

index fcb6ec1af173dfe22e3130ef6016f348c3f24858..72450237a0f418e0a41552cbdefd7943545add78 100644 (file)
@@ -295,6 +295,10 @@ static int check_and_rewind_pc(char *put_str, char *arg)
        /* On x86 a breakpoint stop requires it to be decremented */
        if (addr + 1 == kgdbts_regs.ip)
                offset = -1;
        /* On x86 a breakpoint stop requires it to be decremented */
        if (addr + 1 == kgdbts_regs.ip)
                offset = -1;
+#elif defined(CONFIG_SUPERH)
+       /* On SUPERH a breakpoint stop requires it to be decremented */
+       if (addr + 2 == kgdbts_regs.pc)
+               offset = -2;
 #endif
        if (strcmp(arg, "silent") &&
                instruction_pointer(&kgdbts_regs) + offset != addr) {
 #endif
        if (strcmp(arg, "silent") &&
                instruction_pointer(&kgdbts_regs) + offset != addr) {
@@ -305,6 +309,8 @@ static int check_and_rewind_pc(char *put_str, char *arg)
 #ifdef CONFIG_X86
        /* On x86 adjust the instruction pointer if needed */
        kgdbts_regs.ip += offset;
 #ifdef CONFIG_X86
        /* On x86 adjust the instruction pointer if needed */
        kgdbts_regs.ip += offset;
+#elif defined(CONFIG_SUPERH)
+       kgdbts_regs.pc += offset;
 #endif
        return 0;
 }
 #endif
        return 0;
 }