[PATCH] fix PPC floating point debug

From: Stefani Seibold
Date: Fri Nov 27 2009 - 03:59:23 EST


The PPC architecture is unable to debug applications using hardware
floating point, because it would not save the floating point registers.

After returning from the debugger, the contents of register was
modified. This patch fix this bug.

Signed-off-by: Stefani Seibold <stefani@xxxxxxxxxxx>
---
traps.c | 6 ++++++
1 file changed, 6 insertions(+)

--- linux-2.6.32-rc5/arch/powerpc/kernel/traps.c.orig 2009-11-27 09:47:37.989943124 +0100
+++ linux-2.6.32-rc5/arch/powerpc/kernel/traps.c 2009-11-27 09:47:41.088330825 +0100
@@ -559,6 +559,8 @@ void instruction_breakpoint_exception(st
return;
if (debugger_iabr_match(regs))
return;
+ if (regs->msr & MSR_FP)
+ giveup_fpu(current);
_exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip);
}

@@ -577,6 +579,8 @@ void __kprobes single_step_exception(str
if (debugger_sstep(regs))
return;

+ if (regs->msr & MSR_FP)
+ giveup_fpu(current);
_exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);
}

@@ -834,6 +838,8 @@ void __kprobes program_check_exception(s
regs->nip += 4;
return;
}
+ if (regs->msr & MSR_FP)
+ giveup_fpu(current);
_exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip);
return;
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/