I place breakpoints on a need to know basis.
Suppose I have just made some changes to a script - usually I will do some test runs witt the debugger off. If no errors, I’m done.
If it crashes, I will turn on debug mode, and put a breakpoint just before where it crashes, run the script again and check out the variables used on the line of the crash to understand the reason for the crash.
If there is a big record, list or string involved, then I open an explorer window for that variable(s).
Then I manually step thru the line of the crash itself, and observe the crash again. Sometimes it doesn’t crash because there may be multiple instances where that part of the code is executed, and it only crashes on some of those, so you have to continue executing until the breakpoint is encountered again, until you find the instance of the crash. If you come to realise that the crash only happens when A=6 for example, you can edit the breakpoint to only trigger when A=6
OK, so now you know what happened at the crash itself.
But now the question is usually “How did the variables get into that state?”
If the answer isn’t immediately obvious, my next step is usually to put another breakpoint at the beginning of the handler where the crash occured, run the script, check if the variable states are as expected at beginning of the handler.
If the state at the handler entry is as expected, I will step manually line by line to observe how things went wrong, If its a long handler, and some of the code can obviously be ignored, then right click on an intermediate line, and select “Execute to here”.
If on the other hand, the state at the handler entry is not as expected, the next question is “how did the call to the handler go wrong”
To understand this, first check the hierarchy of handlers in the right hand window. Now the autostepping function can be used to check if the sequence of handler calls is as expected.
Then I will put a breakpoints before every line where the problem handler is called, and use this to discover how the handler call went wrong.