From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123403 invoked by alias); 8 Oct 2018 11:29:50 -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 123380 invoked by uid 89); 8 Oct 2018 11:29:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=totally, 2018-08, 201808, 20180917 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; Mon, 08 Oct 2018 11:29:48 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4DA674E91D; Mon, 8 Oct 2018 11:29:47 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 78A805DD6B; Mon, 8 Oct 2018 11:29:46 +0000 (UTC) Subject: Re: [PATCH] RISC-V: enable have_nonsteppable_watchpoint by default To: Andrew Burgess References: <539c4dcf-8bfa-b567-5112-42eac55645c8@redhat.com> <20180917133425.GL5952@embecosm.com> Cc: Craig Blackmore , gdb-patches@sourceware.org From: Pedro Alves Message-ID: <58ddff80-28b2-f1d3-fb29-c2e4cb6f9a0b@redhat.com> Date: Mon, 08 Oct 2018 11:29:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180917133425.GL5952@embecosm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-10/txt/msg00172.txt.bz2 On 09/17/2018 02:34 PM, Andrew Burgess wrote: > * Pedro Alves [2018-09-17 13:54:38 +0100]: > >> On 09/16/2018 01:13 AM, Craig Blackmore wrote: >>> The RISC-V debug spec 0.13 recommends that write triggers fire before >>> the write is committed. If the target follows this behaviour, then >>> have_nonsteppable_watchpoint needs to be set to 1 so that GDB will step >>> over the watchpoint before checking if the value has changed. >>> >>> This patch adds a setshow for have_nonsteppable_watchpoint which defaults >>> to 1 to match the recommended behaviour. If a target does not follow >>> this timing, then 'set riscv have_nonsteppable_watchpoint 0' will need >>> to be issued on the command line. Do you know of any implementation that _doesn't_ follow the spec? Wondering whether we're adding a knob/complexity for nothing. >>> >>> gdb/ChangeLog: >>> >>> * riscv-tdep.c (set_have_nonsteppable_watchpoint): add >>> callback for 'set riscv have_nonsteppable_watchpoint' >>> (riscv_gdbarch_init): initialise gdbarch setting for >>> have_nonesteppable_watchpoint >> >> This is something the target/stub knows, right? I'd be much >> better to make this automatic, so that users wouldn't have to >> know to tweak anything. > > Sure, you're thinking something like (to pick one at random) how the > 'org.gnu.gdb.arm.neon' feature on ARM in the target description tells > GDB how to operate, right? I totally agree. I wasn't thinking of a target feature, but either a qSupported feature or maybe better, an extension to the watchpoint stop reply ("stopped before/after"). This came up recently here, btw: https://sourceware.org/ml/gdb/2018-08/msg00047.html > > ... but.... we'd still probably want to keep the flag around (though > as an auto/on/off maybe) so the user could, if they wanted, override a > badly behaving target... > > ....and.... there's no current remote description support for RiscV at > all, so having implement that as a prerequisite seems a little steep > (to me). > > My preference would be to allow this in basically as is, then make it > automatic once we have target description support in place. > > Alternatively we could remove the control switch for now, and just go > with: > > set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1); > > for everyone. But if there's anyone out there not following the > recommendation that makes things a little harder for them in the short > term. But is there any evidence of any implementation deviating from the spec's suggestion? From https://sourceware.org/ml/gdb/2018-08/msg00047.html I had assumed that we'd just fix gdb to follow the spec and be done with it. > > What do you think? > Thanks, Pedro Alves