Skip to content

Commit 5b24282

Browse files
committed
ARC: Ignore ptrace SETREGSET request for synthetic register "stop_pc"
ARCompact TRAP_S insn used for breakpoints, commits before exception is taken (updating architectural PC). So ptregs->ret contains next-PC and not the breakpoint PC itself. This is different from other restartable exceptions such as TLB Miss where ptregs->ret has exact faulting PC. gdb needs to know exact-PC hence ARC ptrace GETREGSET provides for @stop_pc which returns ptregs->ret vs. EFA depending on the situation. However, writing stop_pc (SETREGSET request), which updates ptregs->ret doesn't makes sense stop_pc doesn't always correspond to that reg as described above. This was not an issue so far since user_regs->ret / user_regs->stop_pc had same value and both writing to ptregs->ret was OK, needless, but NOT broken, hence not observed. With gdb "jump", they diverge, and user_regs->ret updating ptregs is overwritten immediately with stop_pc, which this patch fixes. Reported-by: Anton Kolesov <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
1 parent d0e639c commit 5b24282

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arc/kernel/ptrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static int genregs_set(struct task_struct *target,
102102
REG_IGNORE_ONE(pad2);
103103
REG_IN_CHUNK(callee, efa, cregs); /* callee_regs[r25..r13] */
104104
REG_IGNORE_ONE(efa); /* efa update invalid */
105-
REG_IN_ONE(stop_pc, &ptregs->ret); /* stop_pc: PC update */
105+
REG_IGNORE_ONE(stop_pc); /* PC updated via @ret */
106106

107107
return ret;
108108
}

0 commit comments

Comments
 (0)