Re: [patch/rfc] Eliminate TARGET_HAS_HARDWARE_WATCHPOINTS

Daniel Jacobowitz
2004-09-09T12:47:53Z

On Thu, Sep 09, 2004 at 07:02:07AM +0300, Eli Zaretskii wrote:
> > Date: Wed, 8 Sep 2004 23:53:37 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> > Cc: cagney@gnu.org, gdb-patches@sources.redhat.com
> >
> > > > 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.
>
> I understand the theory, I just don't know how to test for watchpoint
> support in a program by just compiling it. If you can suggest a
> program whose compilation will reveal that, please do.

There's nothing generic controlled by TARGET_HAS_HARDWARE_WATCHPOINTS.
It controls an include of <sys/debugreg.h> in i386v-nat.c - that can be
autoconf'd, and then checked for the appropriate DR_* constants if
that's necessary. It controls the use of prwatch_t in procfs.c,
likewise.

--
Daniel Jacobowitz