This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Auto-deleting watchpoints
- From: Mihai Basa <Mihai dot Basa at NUIGALWAY dot IE>
- To: gdb at sources dot redhat dot com
- Date: Tue, 02 Dec 2003 20:40:23 +0000
- Subject: Auto-deleting watchpoints
Greetings all!
I'd like to question a certain behaviour of gdb, and I quote from the
man(ual):
"GDB automatically deletes watchpoints that watch local (automatic)
variables, or expressions that involve such variables, when they go out
of scope, that is, when the execution leaves the block in which these
variables were defined."
This includes deleting local watchpoints even when the program makes a call to
a library function (say, sqrt()). I believe this auto-deletion _severly_
reduces the practicality of watchpoints, because they simply go away on the
first call they hit!
I am not totally aware about the way hardware watchpoints behave when the
processor switches Code-Segments (which is what happens?), but couldn't gdb at
least re-enable the watchpoint when it re-enters scope? Is there a bad
side-effect to this that I can't see?
Highest regards!
Mihai Basa