Conditional breakpoints
Have you ever been debugging code that’s in a loop, and the breakpoint keeps hitting? You press continue over and over, hunting for the specific scenario you want to inspect.
Then when you’re close to it - oops! You clicked one extra time, and now you’re past it and have to start again.
You want to use a conditional breakpoint. They are available in most debuggers. You’re able to write an expression that triggers the breakpoint when it evaluates to true.
You could be checking for the specific id of an object of interest or sampling for situations that meet some heuristic.