From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36988 invoked by alias); 27 Aug 2015 15:43:21 -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 36977 invoked by uid 89); 27 Aug 2015 15:43:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 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; Thu, 27 Aug 2015 15:43:19 +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 75F05C15CA93; Thu, 27 Aug 2015 15:43:18 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7RFhHh0009217; Thu, 27 Aug 2015 11:43:17 -0400 Message-ID: <55DF3014.6090301@redhat.com> Date: Thu, 27 Aug 2015 15:43:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ulrich Weigand CC: gdb-patches@sourceware.org Subject: Re: [RFC] Fix SW breakpoint handling for Cell multi-arch References: <20150827115423.571F824DD@oc7340732750.ibm.com> In-Reply-To: <20150827115423.571F824DD@oc7340732750.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-08/txt/msg00796.txt.bz2 On 08/27/2015 12:54 PM, Ulrich Weigand wrote: > Hi Pedro, > > a second major issue with Cell multi-arch debugging right now is related > to the new target-side SW breakpoint handling. Cell uses linux-nat as > primary target for the PowerPC side, which now returns true from the > to_supports_stopped_by_sw_breakpoint hook. > > This works fine for the PowerPC side. However, when a breakpoint on the > SPU side is hit, the kernel does *not* provide a siginfo with TRAP_BRKPT, > but instead simply delivers a SIGTRAP without siginfo. Does si_code indicate that it was a kernel-generated SIGTRAP (that is, SI_KERNEL)? Wondering whether that would still be distinguishable from trace/single-step traps and user sent SIGTRAPs. See comment and table about x86's si_code in nat/linux-nat.h. I don't know whether the SPU has to care about all the cases there, but I suspect not (e.g., I'd assume SPU code can't exec?). If not, then we'll have to cope... :-/ . Any chance the kernel gets fixed, in order for some future gdb stop worrying about this? I was hoping to get rid of the moribund locations heuristic at some point. > The linux-nat > target therefore does not recognize the breakpoint and does decrement > the PC; this completely throws off infrun, which expects the target to > have done this. > > The attached patch fixes this in the spu-multiarch target by overriding > to_wait as well as to to_stopped_by_sw_breakpoint, and handles the SPU > case there. This does seem to fix the problem for me. > > Does this look reasonable to you, or do you have any other suggestions? Looks reasonable to me, if the suggestion above leads nowhere... Thanks, Pedro Alves