This is the mail archive of the
mailing list for the GDB project.
Re: [RFC] Unified watchpoints for x86 platforms
While writing the code for the x86 watchpoint support, a question
popped up regarding the Global Enable and Local Enable flags in the
DR7 (Debug Control) register.
For those who might not remember what those flags are: Each
hardware-assisted breakpoint or watchpoint should be enabled by
setting bits in the DR7 register. A watchpoint can be enabled locally
or globally, depending on which bit in DR7 is set for that watchpoint.
A watchpoint that is enabled locally will only break if it is hit in
the current task. A watchpoint that is enabled globally will break in
Now, I understand that, by and large, x86 platforms enable watchpoints
locally, to avoid spurious traps triggered by other processes. If
that is true, should the code I write use the Local Enable flag
unconditionally? Or perhaps it would be useful to define an API that
enables a target to control whether the global or local enable flag is