From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75202 invoked by alias); 26 Oct 2016 15:25:33 -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 75179 invoked by uid 89); 26 Oct 2016 15:25:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-it0-f47.google.com Received: from mail-it0-f47.google.com (HELO mail-it0-f47.google.com) (209.85.214.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Oct 2016 15:25:30 +0000 Received: by mail-it0-f47.google.com with SMTP id u205so39445106itc.0 for ; Wed, 26 Oct 2016 08:25:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=p6tUBBv38tejY139hnTMpNoYChUTjyDOXXDaRMQwujI=; b=KxKaRrZyDkQPu7TRQtHBucoNWRBkxEc0Ig/JAHwc9p43/y98+jVR4woWbvaEfCawuv OE4UuMXueMjjZnQI0G1vKO646ySTZp1775OKj25mhLfcBHKl0oL+DHvxo0dCgTiIdsZm CwHY3+UrN5HIWXlCfskpSbwODM5JX0UjviOnpenHQv/WwGOkzoNyUlNaN79n+ToLB6R4 xWxssYf2rGtxlNUqqcMMODklGfAU3kZTjzF1veZQs8/ZYpmi8yWfgIknqISLqtIxx1jI cq1xBi/0kvMnX0xoauoZux4p05IMS0aFkSXJZOtoYTTwLZThC5PnggEVlPUQSTsvLg/8 XkgA== X-Gm-Message-State: ABUngvdyb5YGu29ot5AJFRux3uCHe0yzYO8R2WLv48HorxcLWv9V6OkntknyGY34/SFQyhBIRm78bgTGK6tJKg== X-Received: by 10.36.175.83 with SMTP id l19mr6763220iti.48.1477495529023; Wed, 26 Oct 2016 08:25:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.174.16 with HTTP; Wed, 26 Oct 2016 08:25:28 -0700 (PDT) In-Reply-To: <3f5c4d51-e2e8-835a-af3b-e021866e171b@redhat.com> References: <651566f6-e57a-f816-8012-4080d7bc865c@redhat.com> <0c2c2c0f-bb51-7124-8a6d-d3d633788471@redhat.com> <3f5c4d51-e2e8-835a-af3b-e021866e171b@redhat.com> From: Ofir Cohen Date: Wed, 26 Oct 2016 15:25:00 -0000 Message-ID: Subject: Re: False positive permanent breakpoints To: Pedro Alves Cc: "gdb@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00053.txt.bz2 > 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? Yeah, I guess we can live with the minor performance impact we have for now (and fix that in the future). > 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. :-) Alright, thanks! - Ofir Cohen On 26 October 2016 at 18:13, Pedro Alves wrote: > 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 >