This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Watchpoints with condition
- From: Michael Snyder <msnyder at specifix dot com>
- To: Russell Shaw <rjshaw at netspace dot net dot au>
- Cc: gdb at sources dot redhat dot com
- Date: Fri, 30 Nov 2007 17:32:51 -0800
- Subject: Re: Watchpoints with condition
- References: <200711301925.20196.vladimir@codesourcery.com> <4750B480.8060106@netspace.net.au>
On Sat, 2007-12-01 at 12:10 +1100, Russell Shaw wrote:
> Vladimir Prus wrote:
> > GDB presently allow a watchpoint to have a condition, and I wonder
> > what are the use-cases for that.
> >
> > If anybody has used watchpoint in condition in practice when debugging
> > real problem (as opposed to just playing with gdb, or making up
> > possible uses), can he share why it was needed?
>
> I frequently need to enable or set a breakpoint only if another
> previous point in the program has been passed. How do i do that?
set $passed_milestone = 0
break milestone_func
commands
silent
set $passed_milestone = 1
end
break conditional_func if ($passed_milestone)