4 ms·
I very much agree with this (and I tend to fall into the debugger tunnel vision trap!). I therefore start by reading the logs and code, and if this doesn't work
by Agingcoder 4y ago
I very much agree with this (and I tend to fall into the debugger tunnel vision trap!). I therefore start by reading the logs and code, and if this doesn't work (it often does with a little practice), I use print statements.
I have found that reverse debuggers (rr, pernosco) fix the tunnel vision issue by forcing you to identify something wrong ('no, this shouldn't happen') and then letting you work your way up, constantly asking questions ('ok, where is the next thing that doesn't make sense') instead of passively hitting F8.
Basically, debugging is an active process, which requires a proper strategy, and print, code reading, and reverse debuggers all force you to have/design a strategy. Regular forward debugging doesn't in many cases, especially when you are not familiar with the code or the usual strategies you apply don't work in your slightly devious particular case.