Watchpoints

You use watchpoints (sometimes referred to as access breakpoints or memory breakpoints) to halt program execution when your program reads or writes to a specific memory location. You can then examine the call chain, check register and variable values, and step through your code. You can also change variable values and alter the flow of normal program execution.

You can set a watchpoint from the:

The debugger handles both watchpoints and breakpoints in a similar way. You use the Breakpoints view to manage both types. For example, you use the Breakpoints view to add, remove, enable, and disable both watchpoints and breakpoints.

The debugger attempts to set the watchpoint if a session is in progress based on the active debugging context (the active context is the selected project in the Debug view). If the debugger sets the watchpoint when no debugging session is in progress, or when re-starting a debugging session, the debugger attempts to set the watchpoint at startup as it does for breakpoints.

The Problems view displays error messages when the debugger fails to set a watchpoint. For example, if you set watchpoints on overlapping memory ranges, or if a watchpoint falls out of execution scope, an error message appears in the Problems view. You can use this view to see additional information about the error.