From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Simon Marchi <simark@simark.ca>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/testsuite: Run test when software watchpoints are used
Date: Tue, 10 Jul 2018 14:01:00 -0000 [thread overview]
Message-ID: <20180710140104.GF3978@embecosm.com> (raw)
In-Reply-To: <d411f18f-5d7f-9174-65ce-c94762e575c1@simark.ca>
* Simon Marchi <simark@simark.ca> [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
next prev parent reply other threads:[~2018-07-10 14:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-04 16:40 Andrew Burgess
2018-07-06 2:53 ` Simon Marchi
2018-07-06 13:59 ` Andrew Burgess
2018-07-06 14:43 ` Simon Marchi
2018-07-06 23:21 ` Andrew Burgess
2018-07-07 0:47 ` Simon Marchi
2018-07-10 14:01 ` Andrew Burgess [this message]
2018-10-31 13:52 ` Phil Muldoon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180710140104.GF3978@embecosm.com \
--to=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox