This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Fix problem with watchpoint test in gdb.base/commands.exp
- From: "Eli Zaretskii" <eliz at is dot elta dot co dot il>
- To: msnyder at redhat dot com
- Cc: mec at shout dot net, fnf at redhat dot com, gdb-patches at sources dot redhat dot com
- Date: Fri, 03 May 2002 09:44:33 +0300
- Subject: Re: [RFA] Fix problem with watchpoint test in gdb.base/commands.exp
- References: <Pine.SUN.3.91.1020502184723.27891E@is> <3CD18056.893FE00F@redhat.com>
- Reply-to: Eli Zaretskii <eliz at is dot elta dot co dot il>
> 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.