From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eli Zaretskii To: gdb@sources.redhat.com Subject: Re: [RFC] Unified watchpoints for x86 platforms Date: Sat, 24 Feb 2001 10:14:00 -0000 Message-id: <200102241814.NAA00148@indy.delorie.com> References: <200009070855.EAA00749@albacore> <200009071500.LAA07756@indy.delorie.com> <200009081529.e88FTjx15960@debye.wins.uva.nl> <200102101533.KAA10417@indy.delorie.com> <200102151146.NAA28431@is.elta.co.il> <1010215184135.ZM8866@ocotillo.lan> <200102152125.QAA15548@indy.delorie.com> <5melwzd0qr.fsf@jtc.redback.com> <1010216000953.ZM9629@ocotillo.lan> X-SW-Source: 2001-02/msg00341.html 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 any task. 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 used? Opinions?