From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119988 invoked by alias); 18 Sep 2015 18:36:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 119978 invoked by uid 89); 18 Sep 2015 18:36:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-HELO: cvs.linux-mips.org Received: from eddie.linux-mips.org (HELO cvs.linux-mips.org) (148.251.95.138) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 Sep 2015 18:36:31 +0000 Received: (from localhost user: 'macro', uid#1010) by eddie.linux-mips.org with ESMTP id S27013911AbbIRSg3PPVxa (ORCPT ); Fri, 18 Sep 2015 20:36:29 +0200 Date: Fri, 18 Sep 2015 18:36:00 -0000 From: "Maciej W. Rozycki" To: David Daney cc: Luis Machado , gdb-patches@sourceware.org, linux-mips@linux-mips.org Subject: Re: [PATCH] Expect SI_KERNEL si_code for a MIPS software breakpoint trap In-Reply-To: <55FC441F.6080804@gmail.com> Message-ID: References: <1442592647-3051-1-git-send-email-lgustavo@codesourcery.com> <55FC441F.6080804@gmail.com> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00480.txt.bz2 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