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: [RFA] Fix problem with watchpoint test in gdb.base/commands.exp


> Date: Thu, 02 May 2002 11:07:18 -0700
> From: Michael Snyder <msnyder@redhat.com>
> > 
> > Btw, I think this is a misfeature: GDB should disable the watchpoints,
> > but not delete them.
> 
> Hmmm... I thought that was (effectively) what happened.
> I know there's an invisible "out of scope" breakpoint sometimes, 
> and I thought it was that breakpoint that was deleted, not the
> watchpoint itself.  Was I wrong?

It looks like that.  Try this:

  - write a simple program whose `main' assigns a value to a variable;

  - run the program to the entry to `main', then set a hardware
    watchpoint to watch that variable;

  - continue the program, and when the watchpoint is hit, continue it
    again;

  - when `main' is exited, GDB says the watchpoint was deleted;

  - try "info watchpoints" -- you won't see the watchpoint;

  - try rerunning the program -- the watchpoint won't be hit.

So my conclusion is that the watchpoint is really deleted, not just
disabled and/or made invisible.  For watchpoints which are hard to
set up (perhaps for some complicated expression or with complex
conditions), that is a nuisance.


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