4 ms·
If you approach debugging in a very minimalist way, you should never use a debugger because it only serves to complicate things using the I/O subsystem to de
by khitchdee 8y ago
If you approach debugging in a very minimalist way,
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
- john_moscow 8y agoexcept it's much faster to put a few breakpoints than to recompile your code each time you want to add/remove a logging statement.
- jcelerier 8y ago> except it's much faster to put a few breakpoints than to recompile your code each time you want to add/remove a logging statement. 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.
- khitchdee 8y agoIf you don't use a debugger, you don't need an IDE either. A text editor and a compiler is all you need. That simplifies your programming interface a lot.
- tempodox 8y agoYou should never say “never”.
- khitchdee 8y ago... and then never say never again
- elgis 8y agosometimes you might not have even printf available (very low-level software comes to mind) so you're limited to using registers. Without a debugger it would be a nightmare.
- khitchdee 8y agoWhy would you ever need to go below the abstraction level of your high level language to debug. 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.
- elgis 8y ago>Why would you ever need to go below the abstraction level of your high level language to debug. 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?
- khitchdee 8y agoWell, in that case you'll have to make do with whatever interface you are using that doesn't have a screen such as your existing debugger