From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79460 invoked by alias); 23 Feb 2016 00:01:45 -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 79418 invoked by uid 89); 23 Feb 2016 00:01:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:Tue, boil, his, among X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Feb 2016 00:01:41 +0000 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Websense Email Security Gateway with ESMTPS id 4C38A24B2F57F; Tue, 23 Feb 2016 00:01:35 +0000 (GMT) Received: from [10.100.200.149] (10.100.200.149) by hhmail02.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server id 14.3.266.1; Tue, 23 Feb 2016 00:01:38 +0000 Date: Tue, 23 Feb 2016 00:01:00 -0000 From: "Maciej W. Rozycki" To: Luis Machado CC: Pedro Alves , Subject: Re: [PATCH, v3] Expect SI_KERNEL or TRAP_BRKPT si_code values for MIPS breakpoint traps In-Reply-To: <56CB9042.8090809@codesourcery.com> Message-ID: References: <1456179628-14249-1-git-send-email-lgustavo@codesourcery.com> <56CB8E9D.70605@redhat.com> <56CB9042.8090809@codesourcery.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2016-02/txt/msg00672.txt.bz2 On Mon, 22 Feb 2016, Luis Machado wrote: > > > + The MIPS kernel uses the default si_code of SI_KERNEL for software > > > + breakpoints, hardware watchpoints and SIGTRAP's in general. > > > > If we get this for both software breakpoints and hardware watchpoints, > > then it seems to me that this change still leaves watchpoints broken, > > as I can't see how check_stopped_by_watchpoint is reached, in either > > gdb/linux-nat.c or gdbserver/linux-low.c. > > > > Also, "and SIGTRAP's in general." seems wrong. I hope that that's > > not the case for user-sent SIGTRAPs? > > I'll defer that to Maciej, as he knows what the kernel emits here. From his > descriptions, it seems MIPS' kernel pretty much just uses the default si_code > of SI_KERNEL. Yes, for signals produced by the kernel itself, i.e. with `__send_signal' from kernel/signal.c with the `info' argument set to SEND_SIG_PRIV, which the various calls to `force_sig' from arch/mips/kernel/traps.c boil down to. To have the code set to something else `force_sig_info' is used, in the interpretation of `BREAK 6' and `BREAK 7' instructions among other cases. This is also how kill(2) works, setting the code to SI_USER for user-issued signals, which is generic in Linux so any architecture will do the same here. Maciej