Re: [RFA] Fix problem with watchpoint test in gdb.base/commands.exp

Eli Zaretskii
2002-05-03T06:46:03Z

> 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.