You can also right-click on a breakpoint and select the
“Filter..” menu command to indicate that a breakpoint should only be hit if it
occurs on a specific machine, or in a specific process, or on a specific
thread.
TracePoints – Custom Actions When Hitting a BreakPoint
A debugging feature that a lot of people don’t know about is
the ability to use TracePoints. A TracePoint is a breakpoint that has
some custom action that triggers when the breakpoint is hit. This feature
is particularly useful when you want to observe behavior within your
application without breaking into the debugger.
I’m going to use a simple Console application to demonstrate
how we might be able to take advantage of TracePoints. Below is a
recursive implementation of the Fibonacci sequence:
In the application above, we are using
Console.WriteLine() to output the final Fibonacci sequence value for a specific
input. What if we wanted to observe the Fibonacci recursive sequence in
action along the way within the debugger – without actually pausing the
execution of it? TracePoints can help us easily do this.