This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: STOPPED_BY_WATCHPOINT peculiarity
Eli Zaretskii writes:
> > Date: Tue, 2 Apr 2002 13:54:47 -0800
> > From: Doug Evans <dje@transmeta.com>
> >
> > /* It may be possible to simply continue after a watchpoint. */
> > if (HAVE_CONTINUABLE_WATCHPOINT)
> > STOPPED_BY_WATCHPOINT (ecs->ws);
> >
> > STOPPED_BY_WATCHPOINT is a predicate.
> > Therefore at first glance this code is pointless.
>
> Who said predicates cannot have side effects?
They can, but given the choice they don't.
It's poor programming practice.
[pedantic: setting aside predicates that do result caching and the like]