[PATCH] Expect SI_KERNEL si_code for a MIPS software breakpoint trap

Maciej W. Rozycki macro@linux-mips.org
Fri Sep 18 18:36:00 GMT 2015


On Fri, 18 Sep 2015, David Daney wrote:

> We have to be very careful changing the ABI here.
> 
> This is used by almost all userspace code to detect integer division by zero.
> Many things like the libgcj runtime use this to generate runtime exceptions,
> we don't want to break them.

 No worries here, integer division by 0 and overflow use `BREAK 7' and 
`BREAK 6' respectively (or corresponding trap instructions) and these 
cases are already handled correctly, as I implemented many years ago for 
regular MIPS user code and recently fixed for MIPS16 code (and less 
recently for microMIPS code as well).  Have a look at `do_trap_or_bp' in 
arch/mips/kernel/traps.c for details.

 There's no collision with `BREAK 5'; Linux code would of course have to 
treat 5 as an unrecognised for traps and would therefore handle the case 
right in `do_bp' like with kprobe breakpoints.

 I hope this clears your concerns.

  Maciej



More information about the Gdb-patches mailing list