3 ms·
If 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
by Jtsummers 6y ago
If 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