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]

STOPPED_BY_WATCHPOINT peculiarity


Something is not right, or at least confusing, in watchpoint-land.

This code in infrun.c is odd:

    /* 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.

Things are slightly less confusing by recognizing that in the
process of computing STOPPED_BY_WATCHPOINT some debugging printf's
may get printed.  e.g. grep for maint_show_dr in
i386-nat.c:i386_stopped_data_address.

nm-i386.h:
#define STOPPED_BY_WATCHPOINT(W)       (i386_stopped_data_address () != 0)

Is that all there is to it?

If so, a comment should be added, maybe something like

-    /* It may be possible to simply continue after a watchpoint.  */
+    /* It may be possible to simply continue after a watchpoint.
+       While at first glance this code is pointless, STOPPED_BY_WATCHPOINT
+       is called in case there are any maintenance debugging printf's.  */
     if (HAVE_CONTINUABLE_WATCHPOINT)
       STOPPED_BY_WATCHPOINT (ecs->ws);


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