Re: [RFA]: Modified Watchthreads Patch

Eli Zaretskii
2004-12-11T17:30:56Z

> Date: Sat, 11 Dec 2004 11:36:52 -0500
> From: Daniel Jacobowitz <drow@false.org>
> Cc: eliz@gnu.org, jjohnstn@redhat.com, gdb-patches@sources.redhat.com
>
> The kernel implementation of hardware watchpoints is very
> platform-dependent because the hardware implementation of hardware
> watchpoints is very platform-dependent.

??? Are we still talking about x86? If so, there are only 2 possible
mechanisms I know about: (1) debug registers and (2) page-level
protection. Are there any others? Am I missing something?

Of these two, i386-nat.c currently only supports the first one. If we
restrict ourselves for a moment to that single mechanism only, what
platform dependencies are we talking about, as far as the _hardware_
implementation of hardware-assisted watchpoints is concerned? Am I
missing something?

> I would expect that they would always be
> per-thread on any Linux target with true hardware watchpoints. Of
> course, they'll be process global if they're implemented by page
> protections

The implementation that uses debug registers can be either global or
local, depending on some bit in one of the registers. One thing GDB
should know about a platform is how that platform fiddles with that
bit.