From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97073 invoked by alias); 24 Feb 2016 23:20:11 -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 96991 invoked by uid 89); 24 Feb 2016 23:20:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=anticipated, trumps, Hx-languages-length:2145, risk X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 24 Feb 2016 23:20:10 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id D1E357EBA1; Wed, 24 Feb 2016 23:20:08 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1ONK7Vq010791; Wed, 24 Feb 2016 18:20:08 -0500 Message-ID: <56CE3AA6.6090005@redhat.com> Date: Wed, 24 Feb 2016 23:20:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Maciej W. Rozycki" CC: gdb-patches@sourceware.org, "Maciej W. Rozycki" Subject: Re: [PATCH] Handle MIPS Linux SIGTRAP siginfo.si_code values References: <1456332239-24007-1-git-send-email-palves@redhat.com> <56CDFB9B.3090708@redhat.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-02/txt/msg00761.txt.bz2 On 02/24/2016 08:39 PM, Maciej W. Rozycki wrote: > Whereas for real breakpoint hits if we report TRAP_BRKPT for software > breakpoints and TRAP_HWBKPT for hardware data or instruction breakpoints > (the latters once implemented), then the: > > if (GDB_ARCH_IS_TRAP_BRKPT (siginfo.si_code) > && GDB_ARCH_IS_TRAP_HWBKPT (siginfo.si_code)) > > condition will never be true for legitimate SIGTRAP events and the slow > path won't trigger. But then the MIPS variant will need: > > # define GDB_ARCH_IS_TRAP_BRKPT(X) ((X) == SI_KERNEL || (X) == TRAP_BRKPT) > # define GDB_ARCH_IS_TRAP_HWBKPT(X) ((X) == SI_KERNEL || (X) == TRAP_HWBKPT) Exactly. > > to actually recognise these events at all in the first place. So we > better have it right away or updated kernels will break GDB for a change. OK, if you're still willing to change the kernel, let's do it. I had somehow imagined (and reading back, I have no idea why) that you _didn't_ want to change the si_code, if possible, and was going by that. (There's always risk associated with such a change, as it's effectively an ABI break and some tool out there may be relying on SI_KERNEL and may thus stop working correctly. Usually ABI stability trumps "cleanliness", in kernel circles.) > But you haven't put it in your proposal despite my earlier suggestion, > hence my question whether you want this kernel API correction and the > resulting optimisation or not (I do). I was just keeping matters separate, by keeping the patch strictly about fixing the regression with existing kernels. > Given my observations above it looks to me that we only really need the > two macros updated with my proposal on the GDB side and a corresponding > rather trivial kernel update to have the codes set in the first place, and > we can get away without complicating code with an extra run-time probe. > > Have I missed anything? I think not. I've just finished testing it on s390 -- no regressions. I've pushed it in now, as is. I'll follow up with a new patch that makes gdb accept the anticipated new si_codes too. Thanks, Pedro Alves