Re: [patch/rfc] Eliminate TARGET_HAS_HARDWARE_WATCHPOINTS

Daniel Jacobowitz
2004-09-09T03:53:35Z

On Thu, Sep 09, 2004 at 06:39:52AM +0300, Eli Zaretskii wrote:
> > Date: Wed, 8 Sep 2004 11:23:15 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> > Cc: Andrew Cagney <cagney@gnu.org>, gdb-patches@sources.redhat.com
> >
> > Why should the macro matter for remote targets? We should ask the
> > target whether watchpoints are available.
>
> So you are suggesting to replace a configure-time test and the macro
> with a run-time test?

There are already some runtime tests for this. I don't know how well
they all work, but I thought they did. I never implemented watchpoints
for gdbserver, so I never tried them.

>
> > For cross-compiled build, autoconf should work just fine. Compile
> > tests are still available and you shouldn't be using run tests for this
> > sort of thing anyway.
>
> I don't think this kind of test can be done by compiling a program,
> but if you have a specific test in mind, please describe it.
>
> In any case, if what you suggest works, I agree to replacing the macro
> with these alternatives.

There are two cases:
- If we enabled support, GDB could not be compiled. This is amenable
to compile tests.
- If we enabled support, it would not work at runtime. This is
amenable only to runtime tests - either run during configure or run
during execution. I strongly believe the former are wrong in all
but exceptional cases.

--
Daniel Jacobowitz