STOPPED_BY_WATCHPOINT peculiarity

Doug Evans dje@transmeta.com
Fri Apr 5 08:46:00 GMT 2002


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]



More information about the Gdb mailing list