Skip to contentSkip to conversation

RISC-V: Don't increment sepc after breakpoint.

PATCH New Jim Wilson 1 participant 1 message Jul 15, 2018 RISC-V

lore
Share & tools
lore

Jim Wilson

author
#0 lore raw

PATCH 1/1 RISC-V: Don't increment sepc after breakpoint.

Adding 4 to sepc is pointless, and is wrong if we executed a 2-byte compressed breakpoint. This plus a corresponding gdb patch allows compressed breakpoints to work in gdb. Gdb maintainers have already agreed that this is the right approach.

---
 arch/riscv/kernel/traps.c | 1 -
 1 file changed, 1 deletion(-)
arch/riscv/kernel/traps.c +0 -1
index 14fcec5bdd24..ae323071c786 100644
@@ -150,7 +150,6 @@ asmlinkage void do_trap_break(struct pt_regs *regs)
 #endif /* CONFIG_GENERIC_BUG */
 
 	do_trap_siginfo(SIGTRAP, TRAP_BRKPT, regs->sepc, current);
-	regs->sepc += 0x4;
 }
 
 #ifdef CONFIG_GENERIC_BUG
Signature · 1 line
2.17.1