Skip to content

Commit

Permalink
openrisc: fix trap for debugger breakpoint signalling
Browse files Browse the repository at this point in the history
I have been working on getting native Linux GDB support working for the
OpenRISC port.  The trap signal handler here was wrong in a few ways.
During trap handling address (from the EEAR register) is not set by the
CPU, so it is not correct to use here.  We want to use trap as a
break-point so use TRAP_BRKPT.  Adding 4 to the pc was incorrect and
causing GDB to think the breakpoint was not hit.

Fixing these allows GDB to work now.

Signed-off-by: Stafford Horne <[email protected]>
  • Loading branch information
stffrdhrn committed Nov 11, 2020
1 parent f81cc5a commit 28b852b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions arch/openrisc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,7 @@ void __init trap_init(void)

asmlinkage void do_trap(struct pt_regs *regs, unsigned long address)
{
force_sig_fault(SIGTRAP, TRAP_TRACE, (void __user *)address);

regs->pc += 4;
force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->pc);
}

asmlinkage void do_unaligned_access(struct pt_regs *regs, unsigned long address)
Expand Down

0 comments on commit 28b852b

Please sign in to comment.