Skip to content

Commit

Permalink
kgdbts,sh: Add in breakpoint pc offset for superh
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jason Wessel committed Apr 2, 2010
1 parent a0279bd commit cad08ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/misc/kgdbts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
#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) {
Expand All @@ -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;
#elif defined(CONFIG_SUPERH)
kgdbts_regs.pc += offset;
#endif
return 0;
}
Expand Down

0 comments on commit cad08ac

Please sign in to comment.