This is the mail archive of the gdb@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]

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


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