Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cad08ace authored by Jason Wessel's avatar Jason Wessel
Browse files

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: default avatarJason Wessel <jason.wessel@windriver.com>
Acked-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent a0279bd5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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) {
@@ -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;
}