From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61565 invoked by alias); 10 Jul 2018 14:01:16 -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 61533 invoked by uid 89); 10 Jul 2018 14:01:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=WIDTH, suspicion X-HELO: mail-wm0-f67.google.com Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Jul 2018 14:01:14 +0000 Received: by mail-wm0-f67.google.com with SMTP id z13-v6so24471020wma.5 for ; Tue, 10 Jul 2018 07:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oIycQWDo4PdiDQbFoI2NIpUrooqrJlpHxQMU+IEdTuI=; b=ZxRh8q2MJv4goxk5pL7ovaDiq62KPVE2kBd8ECxulDA7BZd82Z3jwiLXpkFjw8rjE1 NY7RSJ1i3PbH+99jYqNUqAZU6CbNyuGgHUOX11elyWbzcp6kb+GmxoKyEolzQlm5kZHq 6oELgVU0F+T3SrWhqjeg2IlKyBms7kZkF1b7uYJ+XHyK/HawETHvlzyJXHpv0Spzh0Zs Ekho61Cy98ZYNQRDtEgUJjXspcrDhcJqIXtcftFU5vQogwUJjuvFHB4YMoLuGg4dWsEH AYMvg3tfk4xFBDeLPA1ZgQiADEgif13TvuWLJyg40NYzfIE0CNzXHahkWhXE6IB5pYoR 9H8A== Return-Path: Received: from localhost (host86-164-199-62.range86-164.btcentralplus.com. [86.164.199.62]) by smtp.gmail.com with ESMTPSA id g17-v6sm3589652wmd.25.2018.07.10.07.01.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Jul 2018 07:01:05 -0700 (PDT) Date: Tue, 10 Jul 2018 14:01:00 -0000 From: Andrew Burgess To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] gdb/testsuite: Run test when software watchpoints are used Message-ID: <20180710140104.GF3978@embecosm.com> References: <20180704164017.5849-1-andrew.burgess@embecosm.com> <20180706135950.GM2675@embecosm.com> <25d43a27477e9ac14c7a0a4dad19d580@simark.ca> <20180706232109.GR2675@embecosm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Fortune: If I don't see you in the future, I'll see you in the pasture. X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00265.txt.bz2 * Simon Marchi [2018-07-06 20:47:16 -0400]: > On 2018-07-06 07:21 PM, Andrew Burgess wrote: > > OK, got you, something like this then: > > Yes, that looks good. However, the test doesn't really work for me here, > even without this patch, I get a ton of failures. Does it work well for you > on native x86_64? If so, I'm fine if you push the patch. Finding it why it > fails on my machine is another story. Here's the gdb.log, for reference. > > https://pastebin.com/raw/izy5c0Eh So... here's what I know so far.... This _used_ to work for me until _very_ recently, but no longer does. My setup at the moment is x86-64, Fedora 27, -uname -sr' output: Linux 4.17.3-100.fc27.x86_64 I'm pretty sure I performed a machine update, including kernel version, in the last few days (since posting this patch) so my suspicion is that this might be to blame. To further back this up, my other machine (which is badly in need of an update) is x86-64, but running Fedora 24, 'uname -sr' output is: Linux 4.11.12-100.fc24.x86_64 And on this machine this test script runs with no unexpected failures. My current guess is that a recent update has changed some aspect of the environment such that the hardware watchpoint support is no longer working as expected. This is a little irritating but I don't think was made worse with my patch, so, with your feedback below fixed, I've pushed this in. Thanks, Andrew > > I just noted two nits: > > > @@ -183,9 +186,10 @@ proc valid_addr_p {cmd offset width} { > > } > > > > # Watch WIDTH bytes at BASE + OFFSET. CMD specifices the specific > > -# type of watchpoint to use. If CMD is "hbreak", WIDTH is ignored. > > +# type of watchpoint to use. If CMD is "hbreak", WIDTH is ignored. The > > +# HW_WP_P flag tells us if harware watchpoints are enabled or not. > > "harware" > > > @@ -249,3 +266,22 @@ foreach always_inserted {"off" "on" } { > > } > > } > > } > > + > > +# Run tests with hardware watchpoints disabled, then again with them > > +# enabled (if this target supports hardware watchpoints). > > +foreach hw_wp_p { 0 1 } { > > + > > + if { $hw_wp_p } { > > + # Does this target support h/w watchpoints? > > + if [target_info exists gdb,no_hardware_watchpoints] { continue } > > + set prefix "hw-watch" > > + } else { > > + set prefix "sw-watch" > > + } > > + > > + gdb_test_no_output "set can-use-hw-watchpoints ${hw_wp_p}" > > + > > + with_test_prefix $prefix { > > + run_watchpoints_tests $hw_wp_p > > + } > > +} > > For just two variations, I am not sure we gain much in readability by doing a loop > here. It might be clearer to do: > > run_tests_software_watchpoints > > if supports_hardware_watchpoints: > run_tests_hardware_watchpoints > > > I don't really mind, it's your choice. > > Simon