visual-studiodebuggingbreakpointsconditional-breakpoint

Break when a value changes using the Visual Studio debugger


Is there a way to place a watch on variable and only have Visual Studio break when that value changes?

It would make it so much easier to find tricky state issues.

Can this be done?

Breakpoint conditions still need a breakpoint set, and I'd rather set a watch and let Visual Studio set the breakpoints at state changes.


Solution

  • In the Visual Studio 2005 menu:

    Debug -> New Breakpoint -> New Data Breakpoint

    Enter:

    &myVariable