Re: adjust watchpoint testing

Wu Zhou
2006-06-12T16:30:07Z

Nathan,

I had similar concerns about these watchpoint tests with you. However,
I'd like to propose a somewhat different solution.

On Fri, 9 Jun 2006, Nathan Sidwell wrote:

> the recurse.exp test presume there are at least two hardware watchpoints.

In my opinion, recurse.exp doesn't presume that. If there is no hardware
watchpoint support, it will use software simulated ones. If the target
can support only one h/w watchpoint, the second will switch to software
watchpoint.

This target-dependent feature might incur confusion some where. One
may have difficulty in knowing for sure what this case is trying to
test: s/w watchpoint, or h/w watchpoint, or both? If there are errors
reported, what type of watchpoint trigger that? To track into the root
cause, which code to look at?

To clarify the situation, I propose to let recurse.exp based on totally on
software simulated watchpoint. This can be done easily, by using "set
can-use-hardware-watchpoint 0".

Then we can add another similar testcase, specifically designed for
hardware watchpoint. This testcase will first detect if there are any
hardware watchpoint in the underlying target. If there are any, then go
on with the test, otherwise skip and quit.

In this h/w watchpoint specific testcase, we can also add some tests for
rwatch and awatch, which is not touched by any testcase in current gdb
testsuite (that is my reading of the code, correct me if I am wrong).

For simplicity, we can use only one watchpoint. This has another strength
in that it don't make any assumption.

This is my rough thought. I had some code, but not finished yet. So I am
very appreciated if anyone can provide any comment or insight into my
proposal. Thanks a lot in advance.

Regards
- Wu Zhou

> This
> patch adds a gdb,hardware_watchpoint target info variable and adjust the test to
> only test where two watchpoints are used, if they exist on the target.
>
> I found it necessary to adjust the watchpoint.exp expected reply too.
>
> ok?
>
> nathan
> --
> Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
> nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
>