This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Expect SI_KERNEL si_code for a MIPS software breakpoint trap
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: David Daney <ddaney dot cavm at gmail dot com>
- Cc: Luis Machado <lgustavo at codesourcery dot com>, gdb-patches at sourceware dot org, linux-mips at linux-mips dot org
- Date: Fri, 18 Sep 2015 19:36:29 +0100 (BST)
- Subject: Re: [PATCH] Expect SI_KERNEL si_code for a MIPS software breakpoint trap
- Authentication-results: sourceware.org; auth=none
- References: <1442592647-3051-1-git-send-email-lgustavo at codesourcery dot com> <alpine dot LFD dot 2 dot 20 dot 1509181729100 dot 10647 at eddie dot linux-mips dot org> <55FC441F dot 6080804 at gmail dot com>
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