Commit cad08acebf4b7d993b0cefb9af67208c48fb9a5e
1 parent
a0279bd580
Exists in
master
and in
39 other branches
kgdbts,sh: Add in breakpoint pc offset for superh
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>
Showing 1 changed file with 6 additions and 0 deletions Side-by-side Diff
drivers/misc/kgdbts.c
... | ... | @@ -295,6 +295,10 @@ |
295 | 295 | /* On x86 a breakpoint stop requires it to be decremented */ |
296 | 296 | if (addr + 1 == kgdbts_regs.ip) |
297 | 297 | offset = -1; |
298 | +#elif defined(CONFIG_SUPERH) | |
299 | + /* On SUPERH a breakpoint stop requires it to be decremented */ | |
300 | + if (addr + 2 == kgdbts_regs.pc) | |
301 | + offset = -2; | |
298 | 302 | #endif |
299 | 303 | if (strcmp(arg, "silent") && |
300 | 304 | instruction_pointer(&kgdbts_regs) + offset != addr) { |
... | ... | @@ -305,6 +309,8 @@ |
305 | 309 | #ifdef CONFIG_X86 |
306 | 310 | /* On x86 adjust the instruction pointer if needed */ |
307 | 311 | kgdbts_regs.ip += offset; |
312 | +#elif defined(CONFIG_SUPERH) | |
313 | + kgdbts_regs.pc += offset; | |
308 | 314 | #endif |
309 | 315 | return 0; |
310 | 316 | } |