This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC/RFA] Add hardware watchpoint support for cygwin target.



On Wed, 28 Nov 2001, Christopher Faylor wrote:

> It seems like the described behavior would be annoying indeed.  It
> would be nice to fix this.

I second that.

In my experience, having watchpoints fire when they shouldn't renders
them almost unusable.  A watchpoint is a kind of a ``silver bullet'':
it is supposed to reveal bugs that cannot be reasonably caught by any
other means, mainly when some code overwrites locations it shouldn't.
They are also very useful when studying complex programs, when you
want to find out which code modifies some variable.

In both of these situations, if a watchpoint triggers when the
variable isn't written, you cannot trust such a watchpoint, because
you have no way of verifying independently whether the watchpoint
should have triggered or not.  (Comparing the old and new values is
not a reliable way to find out whether the address was or wasn't
written to.)

So I'd suggest some more R&D here.  For example, can anyone see if the
debugger which comes with the Visual Studio does TRT with watchpoints?
If it does, it means there is a way, albeit undocumented (so what else
is new in Redmond-land?) to set a watchpoint and have it break on
writes only.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]