by khitchdee · 8y ago · 0 comments
you should never use a debugger
because it only serves to complicate things
using the I/O subsystem to debug your program
is a far more efficient way to debug.
If you do things this way,
you orthogonalize the optimization side of your compiler
from the mess created by trying to assist the debugging process
via the rather complex and intrusive (from the compiler's perspective) component called the debugger
If you're going down into registers, you're obviously debugging the wrong way.
You don't need printf's if you write directly to your screen which is easy to do.
I don't know what you mean by this. If you don't have f.ex. printf available you have to come up with something else.
>You don't need printf's if you write directly to your screen which is easy to do.
What if the hardware you're debugging doesn't have a screen?
that reeaaallly depends. I had cases where adding a printf and recompiling would take mere seconds and a gdb startup on the order of 3 to 4 minutes because recompiling only changes one shared library while GDB has to load all of them.
A text editor and a compiler is all you need.
That simplifies your programming interface a lot.