Auto-deleting watchpoints

Mihai Basa Mihai.Basa@NUIGALWAY.IE
Tue Dec 2 20:38:00 GMT 2003


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



More information about the Gdb mailing list