Debugging Tips

In code I will often put a simple bit like

#if DebugBuild
  if 1 = 2 then break

as a place to put break points that I can toggle as I debug

However, when/if the debugger doesn’t stop at a break point its hard to use this since its not a hard break statement that it WILL stop at

Anyone else got some debugging tips ?

I don’t quite follow - what are you toggling? Why not just use a simple Break statement without the If and the compile conditionals? Break only applies to a debug build/run.

A break point on that line which I see I neglected to mention :slight_smile:
Sometimes you dont want to break all the time
So set a break point on that line or remove it

Don’t step too long through the debugger or the debugger will crash.

If you view the contents of some variables, before you step again, set the debugger popup back to “Variables” (the first entry)
If you leave it viewing the contents of an object that happens to go out of scope its very likely the debugger will crash

I always forget to reset the debugger. That bug is at least 10 years old.

I’d never seen it until the move to LLVM
Its annoying as heck and a real pain to track down