[RFA]: Modified Watchthreads Patch

Daniel Jacobowitz drow@false.org
Sat Dec 11 17:53:00 GMT 2004


On Sat, Dec 11, 2004 at 07:27:26PM +0200, Eli Zaretskii wrote:
> > 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?

No, sorry.  Mark made general comments about "Linux" so that's what I
was responding to.

The range of implementations of MIPS hardware watchpoints, for
instance, are somewhat different than the i386 ones.  You've got the
same two options (that is, if your platform has appropriate debug
registers), but the features offered by the debug registers can vary. 
So can their globalness.  For instance, a platform which only placed
watchpoints on physical addresses instead of virtual addresses would
probably not offer thread-specific setting of the watchpoint registers.
[Do any platforms do that, and also support SMP?  I sure hope not.]

> > 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.

For the Linux kernel, it doesn't matter what you set in that bit.  It
has to clear the registers at task switch anyway, for security reasons.
I imagine this is true on most other protected, multi-tasking OS's
also; am I missing something?

-- 
Daniel Jacobowitz



More information about the Gdb-patches mailing list