From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4642 invoked by alias); 26 Oct 2016 15:14:06 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 4615 invoked by uid 89); 26 Oct 2016 15:14:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:gdbarch, bpoint, alright, concerned 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 ESMTP; Wed, 26 Oct 2016 15:14:01 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5336A3D970; Wed, 26 Oct 2016 15:14:00 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9QFDxeB029923; Wed, 26 Oct 2016 11:13:59 -0400 Subject: Re: False positive permanent breakpoints To: Ofir Cohen References: <651566f6-e57a-f816-8012-4080d7bc865c@redhat.com> <0c2c2c0f-bb51-7124-8a6d-d3d633788471@redhat.com> Cc: "gdb@sourceware.org" From: Pedro Alves Message-ID: <3f5c4d51-e2e8-835a-af3b-e021866e171b@redhat.com> Date: Wed, 26 Oct 2016 15:14:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-10/txt/msg00052.txt.bz2 On 10/26/2016 04:02 PM, Ofir Cohen wrote: >> I'd rather that upstreaming that bit was done when the >> rest of the port is submitted as well. > Alright, will do. > > As a temporary mitigation, > Is it OK for the target to return NULL from gdbarch_breakpoint_from_pc > to state that it doesn't support software breakpoints ? > I think so. > > There are some places that check that return value, like: > /* Software breakpoints unsupported? */ > if (bpoint == NULL) > return 0; > > in bp_loc_is_permanent(), and others that don't, like breakpoint_xfer_memory(). > Furthermore, it performs pointer arithmetic based on the returned value. If you don't have software breakpoints in the list, then bp_location_has_shadow will return false for all breakpoints? Sounds like we could skip most of the work, but that's an optimization, not a correctness issue? > > Currently the tests we have pass, but I'm concerned about other corner > cases are not covered > that might pop up as a result of this change. I can't think of any offhand. Mainly because it's not usual for me to work with targets that don't support sofware breakpoints. So I'd say -- try it and see what breaks. Which you already did. :-) Thanks, Pedro Alves