]> git.samba.org - sfrench/cifs-2.6.git/commitdiff
RISC-V: Don't increment sepc after breakpoint.
authorJim Wilson <jimw@sifive.com>
Sun, 15 Jul 2018 00:34:39 +0000 (17:34 -0700)
committerPalmer Dabbelt <palmer@sifive.com>
Mon, 13 Aug 2018 15:31:30 +0000 (08:31 -0700)
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.

Signed-off-by: Jim Wilson <jimw@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/kernel/traps.c

index 81a1952015a6556d3428f6e3ab3b541d7f371bfa..24a9333dda2cb9bb407d3c4ee1f3954714d30f01 100644 (file)
@@ -138,7 +138,6 @@ asmlinkage void do_trap_break(struct pt_regs *regs)
 #endif /* CONFIG_GENERIC_BUG */
 
        force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)(regs->sepc), current);
-       regs->sepc += 0x4;
 }
 
 #ifdef CONFIG_GENERIC_BUG