3 ms·
Relevant XKCD: "Is it worth the time?" https://xkcd.com/1205/ https://xkcd.com/1205/ It's still unclear to me that learning an interactive debugger would save
by teachingassist 5y ago
Relevant XKCD: "Is it worth the time?" https://xkcd.com/1205/ https://xkcd.com/1205/
It's still unclear to me that learning an interactive debugger would save me any time at all.
Figuring out where I need to judiciously place print statements also helps me to figure out the code in front of me.
- Jtsummers 5y agoIf it lets you avoid recompilation, it's very likely it could save you a significant amount of time. I really learned GDB for an embedded Linux system where it took 5-10 minutes to compile and 5-10 more minutes to load the updated build and then you have to restart the whole device. I don't really feel like spending 20 minutes (worst case) or even 10 minutes (best case) to get to, hopefully, the right printf. Make a build with debug symbols, load it, run it with a debugger attached [0], maybe restart a few times to recreate the error path (which might have to be done with printfs as well). And once that process was established and written down (extra build target, half page of instructions on getting things properly configured for our environment) it became much, much faster than print debugging. [0] https://en.wikipedia.org/wiki/Gdbserver https://en.wikipedia.org/wiki/Gdbserver