KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q24225: The Difference Among Watch, Watchpoint, and Tracepoint

Article: Q24225
Product(s): See article
Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | | mspl13_basic
Last Modified: 14-AUG-1989

Question:

What is the difference between a watch, a watchpoint, and a
tracepoint?

Response:

A "watch" command will monitor an expression or a range of memory
addresses, and update the watch window each time the expression or any
location in the range changes. Using a watch never will cause program
execution to stop; it simply "watches" unconditionally.

A "watchpoint" monitors an expression (and an expression only) during
program execution. It will update its value in the watch window
whenever it changes. However, when the watchpoint expression becomes
true (nonzero), program execution is stopped.

A "tracepoint" monitors an expression or a range of memory addresses
and displays the expression or the range being monitored in the watch
window. It will stop program execution when the expression or any
location in the range changes. Please note that writing over the old
value at a memory location with the same value is not considered a
change.

The following example summarizes this information:

Command     Object To Watch          Conditionally    Condition To
                                     Stops            Stop On
-------     ---------------          -------------    ------------

WATCH       expression or            No               (none)
            range of memory

WATCHPOINT  expression               Yes             expression becomes
                                                     true (nonzero)

TRACEPOINT  expression or            Yes             expression or
            range of memory                          in range changes
                                                     location

Note: the "monitoring" described above is done in only window mode. If
sequential mode is being used, you must use the Watch List command to
see the values of any of the three types of watch statements.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.