This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: STOPPED_BY_WATCHPOINT peculiarity


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

Anyway, this code is there in GDB for as long as I can remember.
Presumably, it's a survivor from the days when watchpoints were added
to GDB for Sparclet or some such.

I don't mind the extra comment, though.  My only request is to change
the wording of the comment so that the kind of use in i386-nat.c is an
example of how it could be used, not the original purpose of this code
(which is unknown to me).  IMHO, the comment should serve as a warning
against the temptation of removing it, or otherwise rewriting it in
ways that could break ecisting usage.

Thanks.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]