The breakpoint entry code has moved the PC on by 4 bytes, so we must move it back. This could be done on the host but we do it here because monitor.S of JATG gdbserver does it.
Signed-off-by: Thomas Chou <[EMAIL PROTECTED]> --- linux-2.6.x/arch/nios2nommu/kernel/traps.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/linux-2.6.x/arch/nios2nommu/kernel/traps.c b/linux-2.6.x/arch/nios2nommu/kernel/traps.c index 6c55c04..e5471b9 100644 --- a/linux-2.6.x/arch/nios2nommu/kernel/traps.c +++ b/linux-2.6.x/arch/nios2nommu/kernel/traps.c @@ -182,13 +182,19 @@ asmlinkage void breakpoint_c(struct pt_regs *fp) { siginfo_t info; +/* The breakpoint entry code has moved the PC on by 4 bytes, so we must */ +/* move it back. This could be done on the host but we do it here */ +/* because monitor.S of JATG gdbserver does it. */ + fp->ea -= 4; + /* printk(KERN_DEBUG "Breakpoint detected, instr=0x%08x ea=0x%08x ra=0x%08x sp=0x%08x\n", *(u32*)((fp->ea)-4), *(u32*)(fp->ea), *(u32*)(fp->ra), *(u32*)(fp->sp)); */ - + info.si_code = TRAP_BRKPT; info.si_signo = SIGTRAP; info.si_errno = 0; + info.si_addr = (void *) fp->ea; force_sig_info(info.si_signo, &info, current); } -- 1.5.3.3 _______________________________________________ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev